in visual studio 2012, have c# project using entity framework (version 6.1.3).
everytime make modifications .edmx file , save them, .cs classes under .tt file re-generated. problem have table named "system" in database (not idea), everytime classes re-generated, visual studio places "system." in front of guid , datetime members
sample code:
namespace projectname.data { using global::system; using global::system.collections.generic; public partial class area { public int areaid { get; set; } public int systemid { get; set; } public string code { get; set; } public string name { get; set; } public bool enabled { get; set; } public system.guid createdbyid { get; set; } public system.datetime createdon { get; set; } } } this causes compilation errors because looking guid , datetime members of entity object "system", instead of system namespace. everytime make change .edmx file, have search , replace in files change "system.datetime" "datetime" , "system.guid" "guid", give following:
namespace projectname.data { using global::system; using global::system.collections.generic; public partial class area { public int areaid { get; set; } public int systemid { get; set; } public string code { get; set; } public string name { get; set; } public bool enabled { get; set; } public guid createdbyid { get; set; } public datetime createdon { get; set; } } } is there option somewhere in visual studio or way configure changing .edmx file doesn't add "system." in front of guid , datetime types?
edit: is, option stop behavior without having rename system table/class
thank you
thats common problem auto generated code , classes match namespace name (windows designer re add full qualified name every time change in designer), rename class , save lot of time.
Comments
Post a Comment