I am the only one at my company that is familiar with MVC and they are getting more pressure to modernize and switch to MVC for future projects, so I was tasked to create a template to use as a base for any training or as a base for new projects. This is perfectly fine and I'm glad to do it.

However, one absolute requirement is that I use EL Data Access Block. Doesn't this kinda defeat the purpose of MVC and using an ORM for simpler data code?

I have tried looking everywhere online for any standard practices when using MVC with DAAB but I cannot find a single good article or tutorial or code anywhere, which leads me to believe I should not do it this way, but i have to..

So, on that note, is it possible for me to use EL Data Access for the Model and set it up so that it can be strongly typed and get it to basically act kinda like EF?

I was thinking that I could just create a t4 template or something to help generate the models based off of the DB tables and add as much of the CRUD operations as I could. No clue if this will be a good idea though.


MVC is primarily a User Interface paradigm. Part of the benefit derived from its modularity is that it shouldn't matter what your data repository looks like.

Just add a Service Layer to access your data repository, whatever that is. If your application is complex enough to require a ORM, creating it with T4 templates is certainly one way to go. In fact, several people have already done the work.

That said, if your employer is big on Microsoft, I don't see why Entity Framework wouldn't be on the table.

  • Ahh thank you for that link! And that makes plenty of sense. As I said, I am familiar with MVC but definitely not well versed in it and have only used MVC with EF so trying to use EL for data was confusing me. And as far as using EL instead of EF, I am all for it but it is our clients requirement to stick with Enterprise Library so we have to adhere to it. Thanks! – Mungoid Jan 13 '14 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.