public T GetConnection(CommittableTransaction transaction = null) { if (Context.IsNull()) { var type = typeof(T); if (transaction.IsNull()) { Context = (T)ObjectFactory.Createinstance(type, new[] { Runtime.Context.GetDefaultConnectionString() }); } else { var dataConnection = new EntityConnection(Runtime.Context.GetDefaultConnectionString()); dataConnection.Open(); dataConnection.EnlistTransaction(transaction); Context = (T)ObjectFactory.Createinstance(type, new[] { dataConnection }); } } return(Context); }