asp.net mvc - How to use Repository and Unit of Work Patterns with ADO.NET? -


i building asp.net mvc 5 application.

i read repository , unit of work (uow) patterns here.

these examples use entity framework adds high-level of abstraction itself.

i using ado.net , not ef. want know:

  1. whether repository , uow patterns makes sense ado.net?
  2. how repositories , uow ado.net? samples?
  3. can add separate class library repository or make part of dal?

i've written blog post teaches on how write driver independent code , how implement uow/repository pattern plain ado.net.

it's bit long include in answer, idbtransaction represent unit of work (or contained in one) , every repository take transaction or uow in it's constructor.

to create command using idbtransaction

using (var cmd = transaction.connection.createcommand()) {     cmd.transaction = transaction;      //do crud operation here. } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -