I have added 4 new methods to my ManagerBase that you might find useful.
Here is the code that ends up being generated in the ManagerBase:
#region Unit Of Work
public void CommitUnitOfWork(UnitOfWork2 uow)
{
CommitUnitOfWork(uow,true);
}
public virtual void CommitUnitOfWork(UnitOfWork2 uow, bool autoCommit)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
uow.Commit(adapter, autoCommit);
}
}
#endregion
#region GetDBCount
protected virtual int GetDbCount(IEntityFields2 fields, RelationPredicateBucket filter,
GroupByCollection groupBy, bool allowDuplicates)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
return adapter.GetDbCount(fields, filter, groupBy, allowDuplicates);
}
}
protected virtual int GetDbCount(IEntityCollection2 collection, RelationPredicateBucket filter,
GroupByCollection groupBy)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
return adapter.GetDbCount(collection, filter, groupBy);
}
}
#endregion
My methods are not static so if you want to use this code, you will need to add the static keyword to methods. You can put this code into the ManagerBase lpt file to create the methods above.
Enjoy.