lundi 28 décembre 2015

EF 4.1 virutal properties (Model First)

I one old project there is used EF 4.1 (Model First). It is better to not update EF at this moment :/

I want to write some unit tests, but I have problem with mocks. EDMX file generate db collections as ObjectSet, which are not virtual, so I can not make mock. My question is how to mark generated ObjectSet properties as virtual?

public ObjectSet<ShipmentWaybillUrl> Shipment { get {...} };

I would like to have, after code generation

public virtual ObjectSet<ShipmentWaybillUrl> Shipment { get {...} };

Aucun commentaire:

Enregistrer un commentaire