Ejemplo n.º 1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     MappingProfile.InitializeAutomapper();
 }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "WiProLocadoraAPI", Version = "v1"
                }); });
            services.AddDbContext <SQLServerDataContext>(options => { options.UseInMemoryDatabase("WiProLocadoraDB"); });
            services.AddSingleton(MappingProfile.InitializeAutomapper().CreateMapper());

            services.AddScoped <IClienteService, ClienteService>();
            services.AddScoped <ILocacaoService, LocacaoService>();
            services.AddScoped <IFilmeService, FilmeService>();

            services.AddScoped <IClienteRepository, ClienteRepository>();
            services.AddScoped <IClienteLocacaoRepository, ClienteLocacaoRepository>();
            services.AddScoped <IElencoRepository, ElencoRepository>();
            services.AddScoped <IFilmeRepository, FilmeRepository>();
            services.AddScoped <IFilmeCategoriaRepository, FilmeCategoriaRepository>();
            services.AddScoped <IFilmeElencoRepository, FilmeElencoRepository>();
            services.AddScoped <IFilmeEstoqueRepository, FilmeEstoqueRepository>();
        }