本文整理汇总了C#中IDatabaseFactory类的典型用法代码示例。如果您正苦于以下问题:C# IDatabaseFactory类的具体用法?C# IDatabaseFactory怎么用?C# IDatabaseFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDatabaseFactory类属于命名空间,在下文中一共展示了IDatabaseFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataSetModel
public DataSetModel(DatabaseInfo targetDatabase, IShellContext context, IDatabaseFactory factory)
{
_targetDatabase = targetDatabase;
_context = context;
_factory = factory;
_dda = _factory.CreateDataAdapter();
}
示例2: DataReaderAdapter
public DataReaderAdapter(IDataReader reader, IDatabaseFactory factory, bool includeHiddenColumns)
{
_reader = reader;
_factory = factory;
_includeHiddenColumns = includeHiddenColumns;
_structure = reader.GetTableInfo(_includeHiddenColumns);
}
示例3: Installer
public Installer( IDatabaseFactory databaseFactory, IStoreService storeService, IPaymentMethodService paymentMethodService, IOrderService orderService )
{
_databaseFactory = databaseFactory;
_storeService = storeService;
_paymentMethodService = paymentMethodService;
_orderService = orderService;
_persistenceInstaller = new PersistenceInstaller( databaseFactory );
}
示例4: UserFactory
public UserFactory(IDatabaseFactory databaseFactory)
{
this._databaseFactory = databaseFactory;
var applicationDbContext = new ApplicationDbContext();
var UserStore = new UserStore<ApplicationUser>(applicationDbContext);
this._userManager = new UserManager<ApplicationUser>(UserStore);
var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));
}
示例5: GetCommands
//public void SaveToXml(XmlElement xml)
//{
// foreach (var elem in Inserts)
// {
// elem.SaveToXml(xml.AddChild("Insert"));
// }
// foreach (var elem in Updates)
// {
// elem.SaveToXml(xml.AddChild("Update"));
// }
// foreach (var elem in Deletes)
// {
// elem.SaveToXml(xml.AddChild("Delete"));
// }
//}
//private void DumpTarget(ISqlDumper dmp, ChangeSetItem item)
//{
// string linkedInfoStr = item.LinkedInfo != null ? item.LinkedInfo.ToString() : "";
// dmp.Put("%s%f", linkedInfoStr, item.TargetTable);
//}
//private void DumpWhere(ISqlDumper dmp, ChangeSetItem item, List<ChangeSetCondition> conditions, DatabaseInfo db)
//{
// dmp.Put("^ where ");
// bool wasCond = false;
// foreach(var cond in conditions)
// {
// if (wasCond) dmp.Put(" ^and ");
// wasCond = true;
// DumpCondition(dmp, item, cond, db);
// }
//}
public DmlfBatch GetCommands(DatabaseInfo db, IDatabaseFactory factory)
{
var disableFks = new HashSet<Tuple<NameWithSchema, string>>();
var dda = factory.CreateDataAdapter();
var converter = new CdlValueConvertor(new DataFormatSettings());
foreach (var upd in Updates)
{
if (upd.DisableReferencedForeignKeys || upd.UpdateReferences || DisableReferencedForeignKeys || UpdateReferences)
{
var table = db.FindTable(upd.TargetTable);
if (table == null) continue;
foreach (var fk in table.GetReferences())
{
disableFks.Add(Tuple.Create(fk.OwnerTable.FullName, fk.ConstraintName));
}
}
}
var res = new DmlfBatch();
foreach (var fk in disableFks) res.DisableConstraint(fk.Item1, fk.Item2, true);
foreach (var ins in Inserts)
{
ins.GetCommands(res, db, dda, converter);
}
foreach (var upd in Updates)
{
upd.GetInsertCommands(res, db, this, dda, converter);
}
foreach (var upd in Updates)
{
upd.GetCommands(res, db, this, dda, converter);
}
foreach (var upd in Updates)
{
upd.GetDeleteCommands(res, db, this);
}
foreach (var del in Deletes)
{
del.GetCommands(res, db, this);
}
foreach (var fk in disableFks) res.DisableConstraint(fk.Item1, fk.Item2, false);
res.Commands.ForEach(x =>
{
var cmd = x as DmlfCommandBase;
if (cmd != null) cmd.SimplifyFromAliases();
});
return res;
}
示例6: SqlDumper
public SqlDumper(ISqlOutputStream stream, IDatabaseFactory factory, SqlFormatProperties props)
{
m_stream = stream;
m_props = props;
m_factory = factory;
m_DDA = m_factory.CreateDataAdapter();
m_formatterState.DDA = m_DDA;
m_dialect = m_factory.CreateDialect();
}
示例7: LogManager
public LogManager(IDatabaseFactory databaseFactory, ICryptoService cryptoService)
{
_dbContext = databaseFactory.Get() as DiabDbContext;
LogCommands = new LogCommands(databaseFactory);
ModelReader = new ModelReader(databaseFactory);
PersonCommands = new PersonCommands(databaseFactory);
FriendCommands = new FriendCommands(databaseFactory);
SecurityLinkCommands = new SecurityLinkCommands(databaseFactory, cryptoService);
}
示例8: RepositoryBase
public RepositoryBase(IDatabaseFactory databaseFactory, IUnitOfWork unitOfWork)
{
if (databaseFactory == null)
throw new ArgumentNullException("databaseFactory");
if (unitOfWork == null)
throw new ArgumentNullException("unitOfWork");
this.unitOfWork = unitOfWork;
DatabaseFactory = databaseFactory;
}
示例9: RegisterFactory
public static void RegisterFactory(IDatabaseFactory factory)
{
foreach(string ident in factory.Identifiers)
{
_factories[ident] = factory;
}
foreach (var type in factory.ConnectionTypes)
{
_factoryByType[type] = factory;
}
}
示例10: SqlScriptCompiler
public SqlScriptCompiler(IDatabaseFactory factory, DataSyncSqlModel datasync, IShellContext context, string procName)
{
_context = context;
_procName = procName;
_datasync = datasync;
_factory = factory;
_sw = new StringWriter();
var so = new SqlOutputStream(factory.CreateDialect(), _sw, new SqlFormatProperties());
so.OverrideCommandDelimiter(";");
_dmp = factory.CreateDumper(so, new SqlFormatProperties());
}
示例11: DatabaseDiff
public DatabaseDiff(DatabaseInfo src, DatabaseInfo dst, DbDiffOptions options, IDatabaseFactory factory)
{
_factory = factory;
_src = src.CloneDatabase();
_dst = dst.CloneDatabase();
_actions = new DbDiffAction(this);
//m_actions = new DiffActionDatabase(this, m_src, m_dst);
_options = options;
RebuildGroupIdDictionary();
if (_src.GroupId != _dst.GroupId) CreatePairing();
CreateActions();
}
示例12: FilterJoinSqlModel
private FilterJoinSqlModel(SourceEntitySqlModel rootModel, SourceGraphSqlModel sourceGraphModel, IDatabaseFactory factory)
{
_sourceGraph = sourceGraphModel;
_rootEntity = rootModel;
_factory = factory;
FillEntitiesOnTheSameServer();
BuildLinkedEntities();
bool hasFilter = _linkedEntities.Any(x => x.Dbsh.Columns.Any(y => y.Filter != null));
if (!hasFilter)
{
_isValid = false;
return;
}
_filteredEntities.AddRange(_linkedEntities);
DetectUnusedEntities();
}
示例13: ProjectRepository
public ProjectRepository(IDatabaseFactory databaseFactory, IDbContext dbContext)
: base(databaseFactory, dbContext)
{
}
示例14: UnitOfWork
public UnitOfWork(IDatabaseFactory dbFactory)
{
this.dbFactory = dbFactory;
}
示例15: PersonController
public PersonController(IDatabaseFactory _databaseFactory)
{
databasePlaceholder = _databaseFactory.GetPersonRepository();
}