Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It sounds like you're working within a framework that was designed by someone else where you have services classes, repositories, and a DAL, and now that you have all this stuff you're looking at the big pile of code and asking "isn't there an easier way". The short answer is yes, there is always an easier way. There are as many different ways of doing data access as there are developers. The model you're using is fairly complex and sounds like it follows the principles of Domain Driven Design. DDD is a great methodology and it provides excellent separation of concerns and high testability. But it also requires a lot of plumbing code and it's not well understood by most .Net programmers so getting help can be tough. I do think it's the best way to build enterprise applications, but it's not the best model for you to follow if you're new to OOP.</p> <p>If you're doing a small project you might want to consider bypassing the BLL altogether, no services classes, no repositories, just have a Common Lib/project that contains your entity classes and build a DLL that contains data access methods that directly populate and save your entities. </p> <p>An even simpler approach is to do away with the entity classes and just have your DLL return ADO.Net DataTables that contain your entity data. This approach looses the strong typing of an entity class but it is much easier to implement. </p> <p>Another approach is to use Entity Framework. EF will do all of this for you and it will generate strongly typed entity classes. It does take a little while to get used to EF but once you understand how to work with it, it can drastically reduce the time it takes you to write persistence code. For some good tutorials on EF, check out <a href="http://blogs.msdn.com/bags/archive/tags/Entity+Framework/default.aspx" rel="nofollow noreferrer">Rob Bagby's blog </a></p>
 

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