Permalink
Find file
a86a1a1 Jul 4, 2015
30 lines (25 sloc) 616 Bytes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Data.Core.Infrastructure
{
public class UnitOfWork : IUnitOfWork
{
private readonly IDbFactory dbFactory;
private DIContext dbContext;
public UnitOfWork(IDbFactory dbFactory)
{
this.dbFactory = dbFactory;
}
public DIContext DbContext
{
get { return dbContext ?? (dbContext = dbFactory.Init()); }
}
public void Commit()
{
DbContext.Commit();
}
}
}