Entity Framework Code First - Two tables, same concept, but different types -


i have database 2 tables, 1 column numeric (19,4) , other float. need map (in entity framework 5 code first) 2 tables in entities have same type, such decimal. change database best solution, although out of question. anyone?

entity framework not support such simple mappings (yet?) require type conversions. on feature request list apparently not decided until if simple type mappings better support in future:

http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/2639292-support-for-simple-type-mapping-or-mapped-type-con

a workaround use two properties in model, 1 not mapped database column , 1 type matching actual type in database, , perform type conversion between 2 properties in getters , setters. example here:

https://stackoverflow.com/a/14221906/270591


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -