【发布时间】:2017-07-13 13:53:44
【问题描述】:
在使用GetAllIncluding 或Include 方法时,有没有办法自动激活“IsSoftDelete”EF Core 过滤器?
public override Task<PublicationDto> Get(EntityDto<Guid> input)
{
var entity = Repository
.GetAllIncluding(x => x.SocialPosts)
.FirstOrDefault(x => x.Id == input.Id);
return Task.FromResult(entity.MapTo<PublicationDto>());
}
【问题讨论】:
-
GetAllIncluding 已经过滤了已删除的行并且只获取未删除的实体 (github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/…)。不行吗?
-
@hikalkan 很奇怪,它对我不起作用。我正在使用最新的模块零模板。
-
我猜你确实从 ISoftDelete 实现了 SocialPost。对吗?
-
是的@AlperEbicoglu
标签: c# aspnetboilerplate