/// <summary> /// 增加MySql模块 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="services"></param> /// <returns></returns> public static IServiceCollection AddMySqlModule <T>(this IServiceCollection services) where T : MySqlConnectionProvider { var module = new MySqlModule(typeof(T)); return(services.AddModule <MySqlModule>(module)); }
/// <summary> /// 增加MySql模块 /// </summary> /// <param name="services"></param> /// <param name="providerFunc"></param> /// <returns></returns> public static IServiceCollection AddMySqlModule(this IServiceCollection services, Func <IServiceProvider, object> providerFunc) { if (providerFunc is null) { throw new ArgumentNullException(nameof(providerFunc)); } var module = new MySqlModule(providerFunc); return(services.AddModule <MySqlModule>(module)); }
/// <summary> /// 增加MySql模块 /// </summary> /// <param name="services"></param> /// <param name="providerType"></param> /// <returns></returns> public static IServiceCollection AddMySqlModule(this IServiceCollection services, Type providerType) { if (providerType is null) { throw new ArgumentNullException(nameof(providerType)); } var module = new MySqlModule(providerType); return(services.AddModule <MySqlModule>(module)); }