public static IServiceCollection AddCoreGateway(this IServiceCollection services, IConfiguration configuration) { ContextFactory.RegisterObject(new CoreContext(services, configuration)); var mapper = new AcubecMapper(new CoreMapper()); services.AddSingleton(typeof(IMapper), mapper); services.AddUtilities(); return(services); }
public static IServiceCollection AddSecurityLayer(this IServiceCollection services, IConfiguration configuration) { ContextFactory.RegisterObject(new SecurityContext(services, configuration)); var connection = MongoDbConnection.FromConnectionString(configuration["ConnectionString"]); services.AddTransient <IDataContext, SecurityDataContext>((s) => new SecurityDataContext(connection)); var mapper = new AcubecMapper(new SecurityMapper()); services.AddSingleton(typeof(IMapper), mapper); services.AddUtilities(); return(services); }
public static IServiceCollection AddGateway(this IServiceCollection services, IConfiguration configuration) { ContextFactory.RegisterObject(new GatewayContext(services, configuration)); var mapper = new AcubecMapper(new GatewayMapper()); services.AddSingleton(typeof(IMapper), mapper); services.AddUtilities(); services.AddHttpClient("SecurityFactory", client => { client.BaseAddress = new Uri(configuration["SecurityBaseURL"]); }); return(services); }