Error
Severity Code Description Project File Line Suppression State
Error CS1501 No overload for method 'ProjectTo' takes 0 arguments
C#
public static async Task<PagedResult<U>> GetPagedAsync<T, U>(this IQueryable<T> query, int page, int pageSize) where U : class
{
var result = new PagedResult<U>();
result.CurrentPage = page;
result.PageSize = pageSize;
result.RowCount = await query.CountAsync();
var pageCount = (double)result.RowCount / pageSize;
result.PageCount = (int)Math.Ceiling(pageCount);
var skip = (page - 1) * pageSize;
result.Results = await query.Skip(skip)
.Take(pageSize)
.ProjectTo<U>()
.ToListAsync();
return result;
}
I am getting above error after migration core 6.0 to core 7.0
ProjectTo
?using AutoMapper;
on top of the class?