public static void RegisterSqlFuConfig(SqlFuConfig config, string schema = null) { config.ConfigureTableForPoco <Commit>(d => { d.TableName = new TableName(ASqlDbProvider.CommitsTable, schema); }); config.ConfigureTableForPoco <Snapshot>(d => { d.TableName = new TableName(ASqlDbProvider.SnapshotsTable, schema); }); config.ConfigureTableForPoco <BatchProgress>(d => d.TableName = new TableName(ASqlDbProvider.BatchTable, schema)); }
public static IDbFactory DbFactory(DbProvider provider, string cnx, Action <SqlFuConfig> config = null) { LogManager.OutputTo(w => Trace.WriteLine(w)); var c = new SqlFuConfig(); SqlFuManager.UseLogManager(); c.ConfigureTableForPoco <IdempotencyTools.IdemStore>(g => { g.TableName = new TableName(IdempotencyTools.DefaultTableName); }); config?.Invoke(c); return(c.CreateFactoryForTesting(provider, cnx)); }
public static DbConnection SqlFuConnection(DbProvider provider, string cnx, Action <SqlFuConfig> config = null) { LogManager.OutputTo(w => Debug.WriteLine(w)); var c = new SqlFuConfig(); c.UseLogManager(); c.WhenType <ArticleType>().WriteAs(a => a.ToString()); c.ConfigureTableForPoco <User>(d => { d.TableName = "Users" + new string(Guid.NewGuid().ToByteArray().ToBase64().Where(w => (w >= 'a' && w <= 'z')).Take(5).ToArray()); d.Property(f => f.Id).IsAutoincremented(); d.IgnoreProperties(f => f.Ignored); }); config?.Invoke(c); return(new SqlFuConnection(provider, cnx, c)); }
static void ConfigSql(SqlFuConfig cfg, TableName name) => cfg.ConfigureTableForPoco <IdemStore>(t => t.TableName = name);