skip to Main Content

EF cannot translate query – Asp.net

I have query for getting data await _dbContext.VwJobSupplierWithScores .Where(x => x.JobId == jobId && x.SupplierKey == supplierKey) .OrderBy(x => x.SpendCurrencyJob) .Select((x, i) => new {item = x, index = i}) .FirstOrDefaultAsync())!, But for some reasons EF cannot translate it and…

VIEW QUESTION

How to get all dates in the last X months – Asp.net

I want to get all dates in the last three months, so I did the following: protected void BindPermissions(int empNum) { var permPeriod = new Dictionary<int, int>(); permPeriod.Add(DateTime.Now.Year, DateTime.Now.Month); permPeriod.Add(DateTime.Now.AddMonths(-1).Year, (DateTime.Now.AddMonths(-1).Month)); permPeriod.Add(DateTime.Now.AddMonths(-2).Year, (DateTime.Now.AddMonths(-2).Month)); var dt = payload_object.AttendancePermissionBO.permissionList .Where(x => x.empNum…

VIEW QUESTION
Back To Top
Search