c# - Using same entity in two models -


i making library used talk database using entity framework. different workflows need different tables database. decided have separate models separate workflows. workflows 1 entity used in multiple models. 1 model have modified entity class (changed getters/setters , added custom functions). when create new model different workflow model generate entity default names. have edit again , code duplicated. both in different namespaces (one model1namespace, second model2namespace).

so need if entity used in different classes single code used (no duplicate code). best practices? ef provide or need implement ourself?

example:

database tables: tablea, tableb, tablec, tabled models: model1 -> tablea, tableb         model2 -> tablea, tablec,         model3 -> tablec, tabled 

edit: have database containing 4 tables (tablea, tableb, tablec, tabled). create entity data model of database contains tablea , tableb. in entity designer view modified names of properties of tablea entity readable. create model contains tablea , tablec. here have rename properties of tablea again. repeat work. if add custom action entity model1 have write (copy) them new model2 entity well. need avoid this. don't know how many models create. , if have stuff again , again take lot of time.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -