When mapping an EF Entity with projection, the Map() method is not called.
public static Expression<Func<global::UnitEntity, UnitDto>> Projection =>
source => new UnitDto
{
Id = source.Id,
...
};
The constructors do call the Map()
public UnitDto(global::UnitEntity source, int __depth, System.Collections.Generic.HashSet<object>? __processed)
{
this.Id = source.Id;
...
global::UnitDtoMapConfig.Map(source, this);
}
Would it not be more maintainable if the Projection() method called the Constructor?
public static Expression<Func<global::UnitEntity, UnitDto>> Projection =>
source => new UnitDto(source, 0, new System.Collections.Generic.HashSet<object>(System.Collections.Generic.ReferenceEqualityComparer.Instance));
That way there is only one set of generated code, and the linearity of the projection (imho) seems more direct. Not sure how this would go with the projection and pulling all the needed includes :-)
When mapping an EF Entity with projection, the Map() method is not called.
The constructors do call the Map()
Would it not be more maintainable if the Projection() method called the Constructor?
That way there is only one set of generated code, and the linearity of the projection (imho) seems more direct. Not sure how this would go with the projection and pulling all the needed includes :-)