Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit of Work Implementation

If anybody can share a link in which Unit of Work pattern is fully implemented in C#? (not using NHibernate or Entity framework)

like image 579
Sathish Avatar asked Apr 06 '11 07:04

Sathish


People also ask

What is the purpose of unit of work pattern?

The Unit of Work pattern is used to group one or more operations (usually database CRUD operations) into a single transaction or “unit of work” so that all operations either pass or fail as one unit.

What is the unity of work?

The SI unit of work is joule (J). Joule is defined as the work done by a force of one newton causing a displacement of one meter. Sometimes, newton-metre (N-m) is also used for measuring work. However, as this unit is also used for torque it can get quite confusing.

What is unit of work in Entity Framework?

The unit of work class serves one purpose: to make sure that when you use multiple repositories, they share a single database context. That way, when a unit of work is complete you can call the SaveChanges method on that instance of the context and be assured that all related changes will be coordinated.

What is unit of work in software development?

Unit of Work is the concept related to the effective implementation of the repository pattern. non-generic repository pattern, generic repository pattern. Unit of Work is referred to as a single transaction that involves multiple operations of insert/update/delete and so on.


1 Answers

Check out Ritesh Rao's NCommon https://github.com/riteshrao/ncommon Or Ayende's Rhino Commons http://www.ayende.com/Wiki/Default.aspx?Page=Rhino+Commons&AspxAutoDetectCookieSupport=1 Or here is an article on implementing UOW by Jeremy Miller http://msdn.microsoft.com/en-us/magazine/dd882510.aspx

like image 85
Andrew Avatar answered Oct 05 '22 02:10

Andrew