C# 我可以使用EF Core 2.0';AsNoTracking';在CRUD服务中获取所有?

C# 我可以使用EF Core 2.0';AsNoTracking';在CRUD服务中获取所有?,c#,entity-framework,asp.net-core,entity-framework-core,aspnetboilerplate,C#,Entity Framework,Asp.net Core,Entity Framework Core,Aspnetboilerplate,我有一个应用程序服务,它实现: public interface IPracticeAppService : IAsyncCrudAppService<PracticeDto, int, PagedAndSortedResultRequestDto,CreatePracticeDto, PracticeDto> 对。但是,.AsNoTracking()仅适用于IQueryable,因此不能调用base方法 public override异步任务GetAll(PagedAndSort

我有一个应用程序服务,它实现:

public interface IPracticeAppService : IAsyncCrudAppService<PracticeDto, int, PagedAndSortedResultRequestDto,CreatePracticeDto, PracticeDto>

对。但是,
.AsNoTracking()
仅适用于
IQueryable
,因此不能调用
base
方法

public override异步任务GetAll(PagedAndSortedResultRequestDto输入)
{
CheckGetAllPermission();
var query=CreateFilteredQuery(输入).AsNoTracking();//这里!
var totalCount=await AsyncQueryableExecuter.CountAsync(查询);
查询=应用排序(查询,输入);
查询=应用页面(查询,输入);
var entities=await AsyncQueryableExecuter.ToListSync(查询);
返回新的PagedResultDto(
总数,
entities.Select(MapToEntityDto).ToList()
);
}

是。但是,
.AsNoTracking()
仅适用于
IQueryable
,因此不能调用
base
方法

public override异步任务GetAll(PagedAndSortedResultRequestDto输入)
{
CheckGetAllPermission();
var query=CreateFilteredQuery(输入).AsNoTracking();//这里!
var totalCount=await AsyncQueryableExecuter.CountAsync(查询);
查询=应用排序(查询,输入);
查询=应用页面(查询,输入);
var entities=await AsyncQueryableExecuter.ToListSync(查询);
返回新的PagedResultDto(
总数,
entities.Select(MapToEntityDto).ToList()
);
}
public override Task<PagedResultDto<PracticeDto>> GetAll(PagedAndSortedResultRequestDto input)
{    
    return base.GetAll(input);
}