c# - Entity Framework Code First CTP5 : How to define non primitive types -
i'm testing ctp5 entity framwork code first, , i've run problem i've got class has property of type uri (system.uri), looks it's unable automatically identify how store that, error like
problem in mapping fragments starting @ line 23:no mapping specified properties webpage.uri in set webpage
how can tell model map uri varchar, example, url of uri??
the actual poco model has bind primitive types. can use complex type binding such as:
[complextype()] public class urihelper { public string stringrepresentation {get;set;} public uri actualuri() { return new uri(stringrepresentation); } }
and in actual object reference complex type uri reference if absolutely need to. mapping reference property actual value string. final option create custom mapping uri string , vice versa ef engine use. however, not advise this. actual database property of type varchar or nvarchar, not uri. ef doesn't know uri is.
Comments
Post a Comment