db查询对象简化

This commit is contained in:
chenchun
2022-09-10 13:36:01 +08:00
parent 0fb57a0a2c
commit eebafda9e5
5 changed files with 9 additions and 8 deletions

View File

@@ -63,8 +63,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers
//还行,直接切换其他仓储,怎么爽怎么来
await _iUserService._repository.ChangeRepository<Repository<RoleEntity>>().GetListAsync();
//最好不要直接操作Db对象
//最好不要在控制器直接操作Db对象
await _iUserService._repository._Db.Queryable<UserEntity>().ToListAsync();
await _iUserService._repository._DbQueryable.ToListAsync();
return Result.Success().SetData(await _iUserService.DbTest());
}