public AmbienteController(GuardaCulturaContext context,
                                  SignInManager <IdentityUser> signInManager,
                                  ILogger <LoginModel> logger)// recebe a bd
        {
            _context = context;

            _signInManager = signInManager;
            _logger        = logger;
        }
Example #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
                              GuardaCulturaContext dbContext,
                              UserManager <IdentityUser> userManager,
                              RoleManager <IdentityRole> roleManager)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=index}/{id?}");//pagina inicial
                //pattern: "{controller=Fotografias}/{action=index}/{id?}");//pagina inicial fotografia
                //pattern: "{controller=Miradouroes}/{action=index}/{id?}");//pagina inicial Miradouros
                //pattern: "{controller=Ambiente}/{action=Miradouros}/{id?}");
                endpoints.MapRazorPages();
            });

            SeedData.SeedRolesAsync(roleManager).Wait();
            SeedData.SeedDefaultAdminAsync(userManager).Wait();//cria sempre
            SeedData.PopulateEssencial(dbContext);

            if (env.IsDevelopment())                                             //ver se está em desenvolvimento
            {
                using (var serviceScope = app.ApplicationServices.CreateScope()) //cria uma area de acesso a servicos
                {
                    //var dbContext = serviceScope.ServiceProvider.GetService<GuardaCulturaContext>();

                    SeedData.SeedDevData(dbContext);
                    SeedData.SeedDevUsersAsync(userManager).Wait();//so cria se tiver em desenvolvimento
                    SeedData.Populate(dbContext);
                }
            }
        }
 public MiradouroesController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
        private readonly GuardaCulturaContext _context;// recebe a bd

        public DuracaosController(GuardaCulturaContext context)
        {
            _context = context;
        }
 public FotografiasController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
 public HorasController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
 public OcupacaosController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
Example #8
0
 public PessoasController(GuardaCulturaContext context, UserManager <IdentityUser> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
Example #9
0
 public HomeController(ILogger <HomeController> logger, GuardaCulturaContext context)
 {
     _logger  = logger;
     _context = context;
 }
Example #10
0
 public EstacaoAnoesController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
 public TipoImagemsController(GuardaCulturaContext context)// recebe a bd
 {
     _context = context;
 }
Example #12
0
 public AtratividadesController(GuardaCulturaContext context)// recebe bd
 {
     _context = context;
 }