public PostsController(IngoContext context, UserManager <UserIdentity> userManager, CurrentUser currentUser , EntityRightsChecker rightsChecker) { _context = context; _userManager = userManager; _currentUser = currentUser; _rightsChecker = rightsChecker; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory , UserManager <UserIdentity> userManager, IngoContext ingoContext) { // if (env.IsDevelopment()) // { app.UseDeveloperExceptionPage(); // } //else //{ // app.UseExceptionHandler("/Error"); // app.UseHsts(); //} app.UseCors(configurePolicy => configurePolicy .AllowAnyHeader() .AllowAnyMethod() .AllowAnyOrigin() .AllowCredentials() ); // loggerFactory.AddFile("logs/log.txt"); app.UseConfiguredSwagger(); app.UseAuthentication(); app.SeedAdmin(userManager, ingoContext); //app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); app.UseSpa(spa => { if (env.IsDevelopment()) { spa.Options.SourcePath = "ClientApp"; spa.Options.StartupTimeout = new TimeSpan(hours: 0, minutes: 2, seconds: 0); spa.UseAngularCliServer("start"); } else { spa.Options.SourcePath = "ClientApp/dist"; } }); }
public AccountController(UserManager<UserIdentity> userManager, SignInManager<UserIdentity> signInManager, IngoContext context , IOptions<JwtSettings> jwtSettings, CurrentUser currentUser, ILogger<AccountController> logger , EmailService emailService) { _userManager = userManager; _signInManager = signInManager; _context = context; _jwtSettings = jwtSettings.Value; _currentUser = currentUser; _logger = logger; _emailService = emailService; }
public BadgesController(IngoContext context) { _context = context; }
public CurrentUser(IngoContext context) { _ingoContext = context; }
public static void SeedAdmin(this IApplicationBuilder app, UserManager <UserIdentity> userManager, IngoContext ingoContext) { var admin = ingoContext.UserProfiles.Find(1); var adminIdentity = userManager.FindByNameAsync("Admin").Result; if (admin.IdentityId == adminIdentity?.Id) { return; } admin.Identity = adminIdentity; ingoContext.UserProfiles.Update(admin); ingoContext.SaveChanges(); }
public EventController(IngoContext context) { _context = context; }
public UsersController(IngoContext context, CurrentUser currentUser, UserManager <UserIdentity> userManager) { _context = context; _currentUser = currentUser; _userManager = userManager; }
public FaqController(IngoContext context) { _context = context; }
public FaqCategoryController(IngoContext context) { _context = context; }