This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Jacob Lewallen (author)
Tue Dec 01 14:33:30 -0800 2009
commit ec4a392d52ad819a96285402dfaf5f2959c6631b
tree 29e3877ed23c385b2117cf4461bc7f4df2ca0e2c
parent 4dc77a60bc204b6a18a22a385ad9104e8fade9c4
tree 29e3877ed23c385b2117cf4461bc7f4df2ca0e2c
parent 4dc77a60bc204b6a18a22a385ad9104e8fade9c4
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Apr 02 12:05:47 -0700 2009 | |
| |
Libraries/ | Sun Apr 12 23:32:20 -0700 2009 | |
| |
Partstore.config | Thu Oct 23 11:40:45 -0700 2008 | |
| |
README.markdown | Fri Oct 24 08:52:45 -0700 2008 | |
| |
Source/ | Tue Dec 01 14:33:30 -0800 2009 | |
| |
rakefile | Thu Apr 02 10:21:34 -0700 2009 |
README.markdown
Machine.UoW
Example
Setting up and configurating for use with NHibernate under ASP.NET:
ISessionFactory sessionFactory = ?;
IUnitOfWorkManagement unitOfWorkManagement = new UnitOfWorkManagement();
unitOfWorkManagement.AddEvents(new NHibernateUoWEvents(sessionFactory));
IUnitOfWorkFactory factory = new UnitOfWorkFactory(unitOfWorkManagement);
UoW.Provider = new HttpContextUnitOfWorkProvider(factory);
From then on, it's a matter of:
using (IUnitOfWork uow = UoW.Start())
{
uow.Session().CreateQuery("FROM People").List<SessionType>();
}
In this case Session() is an extension method provided by the Machine.UoW.NHibernate assembly. Machine.UoW has no dependency on NH.
Settings can be passed to the underlying UoW plugins:
using (IUnitOfWork uow = UoW.Start(new NHibernateSessionSettings(IsolationLevel, FlushMode)))
{
uow.Session().CreateQuery("FROM People").List<SessionType>();
}
Of course you can clean this up, etc... Machine.UoW.NH finds the settings and uses them.







