Note that there are some explanatory texts on larger screens.

plurals
  1. POProper way to handle DataContext in the Application
    primarykey
    data
    text
    <p>Fallowing are the (WPF Windows) Application details</p> <ol> <li>The DB is SQLite and using ADO.net Entity Framework as ORM</li> <li>The DB is very small maximum size of the DB may be between 600 to 800 KB's with around 15 to 20 tables</li> <li>The database is updated only by the server XML file in all the scenarios (that is the xml will be converted to ORM types and will be pushed to the DB through entity FW)</li> <li>So no ORM object from the upper layers will ever be used to update the DB, as we have to regenerate the ORM objects from the XML file to update it to DB</li> </ol> <p>With these requirements what i have done at present is </p> <ol> <li>The data context is not available to any of the controllers except in the DB Layer so no controller is able to update anything to the DB (also cannot navigate from the object through navigation Properties) as only possibility is from the network layer</li> <li>I am converting ORM types to some other dummy type for ex: if ORM has employee class (which is generated from the Framework) I will convert it to Employee Type and send it to upper layers(this will not have any of the navigation properties which will be present in ORM type employee) which will be used by controllers and all other layers and when the xml is received from the network layer it will be sent to the DB Layer which will generate the appropriate ORM types and updates the DB</li> <li>since I am converting it to dummy type I no longer need to worry about data Context life time and not required to recreate the object every time in different method and all the query operations are delegated to DB Layer Is this approach good? </li> </ol> <p>Note: it’s a windows application multi threaded and highly asynchronous</p> <p>so my question is </p> <p>is converting orm type to someother type is a good solution for the problem described?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload