Custom extension methods break EF translation, but we can rewrite them.
public static readonly Projection<DepartmentEntity, DepartmentDto> DepartmentDtoProjection = new (
x => new DepartmentDto
{
Name = x.Name,
Status = x.Status.ToDtoStatus()
}
);
public static StatusDto ToDtoStatus(this Status status)
{
return StatusDtoProjection.Project(status);
}
Can be translated to:
public static readonly Projection<DepartmentEntity, DepartmentDto> DepartmentDtoProjection = new (
x => new DepartmentDto
{
Name = x.Name,
Status = StatusDtoProjection.Project(x.Status)
}
);
Custom extension methods break EF translation, but we can rewrite them.
Can be translated to: