public static IDapperFactoryBuilder AddClient(this IServiceCollection services, Dictionary <string, DapperClient> clientDic) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (clientDic == null) { throw new ArgumentNullException(nameof(clientDic)); } AddClient(services); var builder = new DefaultDapperFactoryBuilder(services, "DbConnedtions"); builder.ConfigureDapperDictionary(clientDic); return(builder); }
public static IDapperFactoryBuilder AddDapper(this IServiceCollection services, string name, Action <ConnectionConfig> configureClient) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } if (configureClient == null) { throw new ArgumentNullException(nameof(configureClient)); } AddDapper(services); var builder = new DefaultDapperFactoryBuilder(services, name); builder.ConfigureDapper(configureClient); return(builder); }