skip to Main Content

EF Core 6 Paging Error: OFFSET must not be negative – Asp.net

I'm doing pagination with EF core 6 and dotnet core. public async Task<IEnumerable<CommentResponse>> GetCommentOfPostAsync(Guid PostId, int PageNumber, int PageSize) => await _context.Comments .Include(comment => comment.User) .OrderBy(comment => comment.CommentId) .Select( data => new CommentResponse { CommentId = data.CommentId, UserId = data.UserId,…

VIEW QUESTION

Serialization and deserialization of > 'System.Action' ASP.NET

var json = JsonConvert.SerializeObject(data); var stringContent = new StringContent(json, Encoding.UTF8, "application/json"); var httpContent = new MultipartFormDataContent(); httpContent.Add(stringContent, "params"); using var httpClientHandler = new HttpClientHandler(); httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; var httpClient = new HttpClient(httpClientHandler); var response = await httpClient.PostAsync(url, httpContent); response.EnsureSuccessStatusCode(); if…

VIEW QUESTION

How to optimize this query with EF? – Asp.net

I am trying to optimize this query using EF. This is the query that I had at the beginning. var result = new List<string>(); _dbContext.signumid_organization.ToListAsync().Result.ForEach(organization => { if (CalculateDifferenceBetweenEntriesAndConsummations(null, organization.Id).Result > threshold) { return; } if (!string.IsNullOrEmpty(organization.Admin)) { result.Add(organization.Admin); }…

VIEW QUESTION
Back To Top
Search