2

In reference to this post

Using ASP.Net MVC with Classic ADO.Net

I wanted a bit of help regarding building an MVC application using a database that I have no access to change, which has tables with no primary keys and some with no discernable unique combination of fields to use as a composite key.

I only have some basic experience with Entity Framework and ADO.NET.. and so I felt that example post was a good way to go.

I am also interested in whether http://code.google.com/p/dapper-dot-net/ could also achieve what I want to do and whether it is worth spending the time then learning that over writing the data access myself? considering I am not greatly experienced in either.

Any help on this would be great. Thanks

Community
  • 1
  • 1
Pricey
  • 5,799
  • 12
  • 60
  • 84

1 Answers1

2

One major benefit of dapper over rolling your own data access is in the mapping of data to POCO's which greatly simplifies converting your query to a domain object. We have recently moved from a full ORM (NHibernate) to dapper and have found the benefits of automapping from dapper and the ability to handle our own querying works really well.

It will come down to what suits you and your team best but learning dapper can only add another usefull tool to your toolbox.

Also, if you are comfortable with ado.net dapper really isn't much of a mental jump.

As far as the poor design of the database you can't change is concerned that will always be your bottleneck regardless of how you access it, there really is not a substitute for a primary key as a minimum requirement from a datastore but dapper should make your life as s developer more comfortable!

Rich Andrews
  • 4,168
  • 3
  • 35
  • 48
  • Ok cool thanks for the reply, as for the querying the database using Dapper, will this be possible when there are no primary keys to distinguish unique records? – Pricey Nov 29 '12 at 19:40
  • Yes, anything you can do with sql you can do with dapper, the benefit comes with automatically mapping your results to domain objects with minimum performance overhead – Rich Andrews Nov 29 '12 at 19:51