I am using Entity Framework in my dataaccess layer, i also use this as my object model.
psudo object model:
public class Item{
public string ID{get;set;}
public string Name{get;set;}
public Xml Data{get;set;}
}
The Data property is the key here. i would like to be able to do this:
Psudo:
var item = Items.Get(id: 1);
var xmlValue = item["key"];
I would like to be able to extend the EF generated class Item with a new property where i use some logic to get a value by key from the xml.
My problem is:
- I find EF data model not very easy to work with and when i want to update the Item table, i cannot be sure my extended logic will stand.
- I dont think i want to add an extracted model and do a convert the EF Item to My.Item every time. This will be a heavy opeartion if the table gets big.
What is a good way to extend the EF object model?
that i dont