/// <summary> /// Register the MySql implementation of IParameterBuilder, SchemaWriter and QuerySet for the /// database associated with the specified type. /// </summary> /// <typeparam name="T"></typeparam> public static void Register <T>() where T : Dao { Register(Db.For <T>().ServiceProvider); }
/// <summary> /// Register the MySql implementation of IParameterBuilder, SchemaWriter and QuerySet for the /// database associated with the specified connectionName. /// </summary> public static void Register(string connectionName) { Register(Db.For(connectionName).ServiceProvider); }
/// <summary> /// Register the MySql implementation of IParameterBuilder, SchemaWriter and QuerySet for the /// database associated with the specified type. /// </summary> public static void Register(Type daoType) { Register(Db.For(daoType).ServiceProvider); }
/// <summary> /// Execute the specified SqlStringBuilder using the /// specified generic type to determine which database /// to use. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="builder"></param> public virtual void ExecuteSql <T>(SqlStringBuilder builder) where T : Dao { Database db = Db.For <T>(); // TODO: review this. It seems stupid to get the database when we ARE a database ExecuteSql(builder, db.ServiceProvider.Get <IParameterBuilder>()); }
/// <summary> /// Registers SQLite as the handler for the specified generic type T. /// This dao handler will register apropriate DatabaseInitializer and /// ConnectionStringResolver. This behavior is different compared to the /// SqlClientRegistrar's Register method. /// </summary> public static void Register <T>() where T : Dao { SetInitializerAndConnectionStringResolver(typeof(T)); Register(Db.For <T>().ServiceProvider); }
/// <summary> /// Registers SQLite as the handler for the specified type. /// This dao handler will register apropriate DatabaseInitializer and /// ConnectionStringResolver. This behavior is different compared to the /// SqlClientRegistrar's Register method. /// </summary> public static void Register(Type daoType) { SetInitializerAndConnectionStringResolver(daoType); Register(Db.For(daoType).ServiceProvider); }
/// <summary> /// Registers SQLite as the handler for the specified connection name. /// This dao handler will register apropriate DatabaseInitializer and /// ConnectionStringResolver. This behavior is different compared to the /// SqlClientRegistrar's Register method. /// </summary> /// <param name="connectionName"></param> public static void Register(string connectionName) { SetInitializerAndConnectionStringResolver(connectionName); Register(Db.For(connectionName).ServiceProvider); }
public static DaoTransaction BeginTransaction(Type type) { Database original = Db.For(type);//_.Db[type]; return(BeginTransaction(original)); }