I looked at this class blog called "NHibernate and the work block" and asked a question about the best place to use UnitOfWork.Start in the asp.net mvc project.
My SLN is divided into the following projects: -
MVC project Repository NHibernateUnitOfWork
I have an interface: -
public interface INameRepository ... IList<Name> GetByOrigin(int OriginId) ...
I have a specific implementation
public class NameRepository : INameRepository ... public IList<Name> GetByOrigin(int OriginId) { using (UnitOfWork.Start()) { var query = session.Linq<... return query; } } ...
My question is whether I wrap all my methods in all my repositories using (UnitOfWork.Start ()) or is there a better approach?
I am using nHibernate, asp.net mvc.
c # asp.net-mvc unit-of-work nhibernate
Fred smith
source share