Пример #1
0
 public RegisterModel(
     UserManager <IdentityUser> userManager,
     SignInManager <IdentityUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     UPMobileContext context)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _emailSender   = emailSender;
     _context       = context;
 }
Пример #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, UPMobileContext context, UserManager <IdentityUser> gestorUtilizadores, RoleManager <IdentityRole> gestorRoles)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseMigrationsEndPoint();
            }
            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.UseNotyf();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });

            SeedData.InsereRolesAsync(gestorRoles).Wait();
            SeedData.InsereAdministradorPadraoAsync(gestorUtilizadores).Wait();

            if (env.IsDevelopment())
            {
                SeedData.PreencheDadosFicticios(context);
                SeedData.InsereUtilizadoresFicticiosAsync(gestorUtilizadores).Wait();
            }
        }
Пример #3
0
 public FaturasController(UPMobileContext context, IEmailSender emailSender)
 {
     _context     = context;
     _emailSender = emailSender;
 }
Пример #4
0
 public HomeController(ILogger <HomeController> logger, INotyfService notyf, UPMobileContext context)
 {
     _logger  = logger;
     _notyf   = notyf;
     _context = context;
 }
 public PacotesComerciaisController(UPMobileContext context)
 {
     _context = context;
 }
Пример #6
0
 public ReclamacoesController(UPMobileContext context)
 {
     _context = context;
 }
Пример #7
0
 public EstadosController(UPMobileContext context)
 {
     _context = context;
 }
Пример #8
0
 public UtilizadoresController(UPMobileContext context)
 {
     _context = context;
 }
Пример #9
0
 public PromocoesController(UPMobileContext context)
 {
     _context = context;
 }
 public ContratosConteudosController(UPMobileContext context)
 {
     _context = context;
 }
Пример #11
0
 public DistritosController(UPMobileContext context)
 {
     _context = context;
 }
Пример #12
0
 public RolesController(UPMobileContext context)
 {
     _context = context;
 }