Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use Entity Framework in Enterprise application
    primarykey
    data
    text
    <p>i have some questions of how to use the Entity Framework in an enterprise application.</p> <p>First of all, i work with ADO.NET for many years now and i use objects to reflect the data that i get from the database provider. Every time i want to change something or insert something into the database.</p> <p>I just call a Save() method and get the job done. Every object has a <code>DatabaseManager</code> that manage the queries to the <code>DataAccess</code> layer. For example</p> <pre><code>public class Article{ public int ID{get;set;} public string Title{get;set;} ..... public bool Save(){ if(this.ID == -1){ return new ArticleDatabaseManager().InsertArticle(this); }else{ return new ArticleDatabaseManager().UpdateArticle(this); } } } public ArticleDatabaseManager : DatabaseManager { ...ADO.NET code } </code></pre> <hr> <p>I don't know if i have to use the same architectur or change all the way i use this objects in my application.</p> <p>I thought if i create something like the above i can do something like this : </p> <pre><code>public class Article{ public int ID{get;set;} public string Title{get;set;} ..... public bool Save(){ if(this.ID == -1){ return new ArticleDatabaseManager().InsertArticle(this); }else{ return new ArticleDatabaseManager().UpdateArticle(this); } } } </code></pre> <p>In the Each DatabaseManager implements some Link To Entities or even EntitySQL to do the same job like the old DatabaseManager does. Fill the Business models with the values that i from the Entity Objects. Then i could work with the Business as before and just any time i want to do some changes i communicate via EntityFramework to the Database.</p> <p>Sould i implement something like the above?</p> <p>Sould i just inherit the previous business objects to the entity objects?</p> <p>EX : </p> <pre><code> public class Article : ArticleEntity { //some properties for validation etc } </code></pre> <p>Sould i use something completely different? I Just Don't knwo:/</p> <p>I have no experience with other ORM. Just mine hand written "ORM" System.</p> <p>Thank you very much. I'm sorry for my lack of English and i know that i ask too much in a single question... But moving from one technology to an other for a dinosaur like me is like i change Country:/</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.
 

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