mardi 25 avril 2017

How to materialize extended properties in EF6 using raw sql?

I have used EFExtension.dll with EF5 like this:

ents.CreateStoreCommand(sql).Materialize<MYTYPE>()

now I am migrating to EF6. As I understood the EFExtension is expecting the ents to be System.Data.Objects.ObjectContext, while in EF6 its System.Data.Entity.Core.Objects.ObjectContext hence I cant use it.

I tried to replace it with the "stock" EF method like this:

ents.ExecuteStoreQuery<MYTYPE>(sql)

but it skips several fields which declared not in the model but in the partial class extension. they are not part of the DB table - they normally are results of joins to another tables and belong architecturally to the "object" part of the entity but not the "storage" part.

Anyone can help to solve this ?

Aucun commentaire:

Enregistrer un commentaire