本文整理汇总了C#中IDatabaseFactory类的典型用法代码示例。如果您正苦于以下问题:C# IDatabaseFactory类的具体用法?C# IDatabaseFactory怎么用?C# IDatabaseFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDatabaseFactory类属于命名空间,在下文中一共展示了IDatabaseFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DataSetModel
public DataSetModel(DatabaseInfo targetDatabase, IShellContext context, IDatabaseFactory factory)
{
_targetDatabase = targetDatabase;
_context = context;
_factory = factory;
_dda = _factory.CreateDataAdapter();
}
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:DataSetModel.cs
示例2: DataReaderAdapter
public DataReaderAdapter(IDataReader reader, IDatabaseFactory factory, bool includeHiddenColumns)
{
_reader = reader;
_factory = factory;
_includeHiddenColumns = includeHiddenColumns;
_structure = reader.GetTableInfo(_includeHiddenColumns);
}
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:DataReaderAdapter.cs
示例3: Installer
public Installer( IDatabaseFactory databaseFactory, IStoreService storeService, IPaymentMethodService paymentMethodService, IOrderService orderService )
{
_databaseFactory = databaseFactory;
_storeService = storeService;
_paymentMethodService = paymentMethodService;
_orderService = orderService;
_persistenceInstaller = new PersistenceInstaller( databaseFactory );
}
开发者ID:uniquelau,项目名称:Tea-Commerce-for-Umbraco,代码行数:8,代码来源:Installer.cs
示例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()));
}
开发者ID:huuphuu,项目名称:pendesignvn,代码行数:8,代码来源:UserFactory.cs
示例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;
}
开发者ID:dbshell,项目名称:dbshell,代码行数:92,代码来源:ChangeSetModel.cs
示例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();
}
开发者ID:dbshell,项目名称:dbshell,代码行数:9,代码来源:SqlDumper.cs
示例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);
}
开发者ID:riccardone,项目名称:myselflog,代码行数:9,代码来源:LogManager.cs
示例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;
}
开发者ID:modulexcite,项目名称:framework-1,代码行数:11,代码来源:RepositoryBase.cs
示例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;
}
}
开发者ID:dbshell,项目名称:dbshell,代码行数:11,代码来源:FactoryProvider.cs
示例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());
}
开发者ID:dbshell,项目名称:dbshell,代码行数:12,代码来源:SqlScriptCompiler.cs
示例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();
}
开发者ID:dbshell,项目名称:dbshell,代码行数:12,代码来源:DatabaseDiff.cs
示例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();
}
开发者ID:dbshell,项目名称:dbshell,代码行数:21,代码来源:FilterJoinSqlModel.cs
示例13: ProjectRepository
public ProjectRepository(IDatabaseFactory databaseFactory, IDbContext dbContext)
: base(databaseFactory, dbContext)
{
}
开发者ID:xuantranm,项目名称:V3System,代码行数:4,代码来源:ProjectRepository.cs
示例14: UnitOfWork
public UnitOfWork(IDatabaseFactory dbFactory)
{
this.dbFactory = dbFactory;
}
开发者ID:NadiaBourourou,项目名称:MedtravGtech,代码行数:4,代码来源:UnitOfWork.cs
示例15: PersonController
public PersonController(IDatabaseFactory _databaseFactory)
{
databasePlaceholder = _databaseFactory.GetPersonRepository();
}
开发者ID:krembf,项目名称:MyLeague,代码行数:4,代码来源:PersonController.cs
示例16: BaseService
protected BaseService(IDatabaseFactory databaseFactory)
{
DatabaseFactory = databaseFactory;
}
开发者ID:alana1,项目名称:NancySamples,代码行数:4,代码来源:BaseService.cs
示例17: UnitOfWork
public UnitOfWork(IDatabaseFactory databaseFactory)
{
this._databaseFactory = databaseFactory;
this.DataContext.ObjectContext().SavingChanges += (sender, e) => BeforeSave(this.GetChangedOrNewEntities());
}
开发者ID:Viggz,项目名称:RealTimeTest2,代码行数:5,代码来源:UnitOfWork.cs
示例18: UnityOfWork
public UnityOfWork(IDatabaseFactory databaseFactory)
{
this.databaseFactory = databaseFactory;
}
开发者ID:halowangquan,项目名称:EFMvcFrameApp,代码行数:4,代码来源:UnityOfWork.cs
示例19: UnitOfWork
public UnitOfWork(IDatabaseFactory databaseFactory)
{
this.databaseFactory = databaseFactory;
_saved = false;
}
开发者ID:kamiken,项目名称:KSG-Mobile,代码行数:5,代码来源:UnitOfWork.cs
示例20: GenerateSql
public override string GenerateSql(IDatabaseFactory factory, IShellContext context)
{
var model = GetModel(context);
var sqlModel = new DataSyncSqlModel(model, context, true, context.Replace(GetProviderString(context)));
return sqlModel.GenerateScript(factory, context, UseTransaction, sqlModel.Parameters, GetParameterValues(context)) + SqlEditorInfoTool.FormatEditorInfo(EditorInfo);
}
开发者ID:dbshell,项目名称:dbshell,代码行数:6,代码来源:Run.cs
注:本文中的IDatabaseFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论