

1·
2 years agoI can certainly test this. My question would then be, will this result in actually mapping a null in the dto, or would the .ExampleProperty? just “be null” and cause the long property to instantiate to 0?


I can certainly test this. My question would then be, will this result in actually mapping a null in the dto, or would the .ExampleProperty? just “be null” and cause the long property to instantiate to 0?


I enjoy Nick Chapsas videos as @[email protected] mentions. Other videos that pop up end up being “day in the life” type stuff rather than instructional/information content.
So… When I change…
.ForMember(ee => ee.ExampleId, options => options.MapFrom(ed => ed.ExampleProperty != null ? ed.ExampleProperty.ExampleId : (long?)null))TO:
.ForMember(ee => ee.ExampleId, options => options.MapFrom(ed => ed.ExampleProperty?.ExampleId))I am presented with: CS8072 - An expression tree lambda may not contain a null propagating operator.