public static IServiceCollection AddCoreConfiguration(this IServiceCollection services, IConfiguration configuration) { return(services .AddScoped <IGameService, GameService>() .AddScoped <IRepository <GameEntity>, GameRepository>() .AddSingleton <IDbConnectionFactory>(factory => new SqlConnectionFactory(configuration.GetConnectionString("CoreData"))) .AddSingleton(AutoMapperConfiguration.CreateConfiguration().CreateMapper())); }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); AutoMapperConfiguration.CreateConfiguration(); }