EntitySql CreateQuery Return Type

.net c# entity-framework-6 entity-sql

Accepted Answer

Use the DbDataRecord for that, and then map it to an object (a DTO, or the dynamic object). Here is an illustration of how to accomplish it: http://www.codeproject.com/Articles/152742/EF-DbDataRecord-ConvertTo.

This type of ORM access has the drawback of destroying the abstraction it offers. Because the object you are utilizing is not included in the model, you cannot utilize the Mapper offered by the CreateQuery.

You may view some usage examples for the Mapper here: AutoMapper and Entity Framework ( Entity to DTO and DTO to Entity ).

Because Linq has the ability to build anonymous types, I advise using it. And since it is not too complicated, you don't need to manually generate SQL for that join. Framework for Entities left join

1
5/23/2017 12:11:13 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow