// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ApplContext applContext) { applContext.Database.Migrate(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); }
public HomeController(UserManager <AppIdentityUser> userManager, ApplContext context, IEmailSender emailSender, LocService locService) { _userManager = userManager; _context = context; _emailSender = emailSender; _locService = locService; }
public ContestentsCreateEditModelView(IServiceProvider serviceProvider) { _appContext = serviceProvider.GetService <ApplContext>(); _idContext = serviceProvider.GetService <IdContext>(); _serviceProvider = serviceProvider; this.GetSelectListItems(); _roleManager = serviceProvider.GetService <RoleManager <ApplicationRole> >(); _userManager = serviceProvider.GetService <UserManager <ApplicationUser> >(); }
public UserProfilesController(ApplContext context, UserManager <User> userManager, ILogger <UserProfilesController> l, iUserProfileService service) { _context = new UnitOfWork(); logger = l; this.userManager = userManager; profileService = service; }
public AuditionsController(ApplContext context, ILogger <AuditionsController> logger, IHostingEnvironment appEnvironment, iAuditionService auditionService) { _context = new UnitOfWork(); _logger = logger; _appEnvironment = appEnvironment; this.auditionService = auditionService; }
public static async Task <TournementViewModel> GetWithId(ApplContext _context, int?id) { var tournement = await _context.Tournement.FindAsync(id); TournementViewModel tournementViewModel = new TournementViewModel() { Id = tournement.Id, Name = tournement.Name, RegistrationStartDate = tournement.TournementStartDate }; return(tournementViewModel); }
public ProjectController(UserManager <AppIdentityUser> userManager, ApplContext context, ILogger <ProjectController> logger, IHostingEnvironment environment, IFileProvider fileProvider, LocService locService) { _userManager = userManager; _context = context; _logger = logger; _environment = environment; _fileProvider = fileProvider; _locService = locService; }
public AccountController(SignInManager <AppIdentityUser> signInManager, UserManager <AppIdentityUser> userManager, RoleManager <AppIdentityRole> roleManager, LocService loc, IEmailSender emailSender, IConfiguration configuration, ApplContext context) { _signInManager = signInManager; _userManager = userManager; _roleManager = roleManager; _loc = loc; _emailSender = emailSender; _configuration = configuration; _context = context; }
// <summary> // This indexer is used to retrieve AppSettings from Memory // </summary> public string this[string Name] { get { //See if we have an AppSettings Cache Item if (HttpContext.Current.Cache["AppSettings"] == null) { int?TenantID = 0; //Look up the URL and get the Tenant Info using (ApplContext dc = new ApplContext()) { Site result = dc.Sites .Where(a => a.Host == HttpContext.Current.Request.Url. Host.ToLower()) .FirstOrDefault(); if (result != null) { TenantID = result.SiteID; } } AppSettings.LoadAppSettings(TenantID); } Hashtable ht = (Hashtable)HttpContext.Current.Cache["AppSettings"]; if (ht.ContainsKey(Name)) { return(ht[Name].ToString()); } else { return(string.Empty); } } }
public CommentsController(ApplContext context, iCommentService commentService) { _context = new UnitOfWork(); this.commentService = commentService; }
public PostsIndexViewComponent(ApplContext context) { _context = context; }
public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env, ApplContext context, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } var optionss = new RewriteOptions().AddRedirectToHttps(); app.UseRewriter(optionss); var locOptions = app.ApplicationServices.GetService <IOptions <RequestLocalizationOptions> >(); app.UseRequestLocalization(locOptions.Value); app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(options => { options.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context); }
public AccountController(UserComponent usrComponent, ApplContext context) { this.userComponent = usrComponent; this.dbContext = context; }
public ContestentsCreateEditModelView(ApplContext appContext, IdContext idContext) { _appContext = appContext; _idContext = idContext; this.GetSelectListItems(); }
public MessagesController(ApplContext context) { _context = new UnitOfWork(); }
public PostsController(ApplContext context, IHostingEnvironment appEnvironment, iPostService postService) { this.postService = postService; _context = new UnitOfWork(); _appEnvironment = appEnvironment; }
public EditorPanelViewComponent(ApplContext context, IConfiguration configuration) { _context = context; _configuration = configuration; }
public LocalesListIndexViewComponent(ApplContext context, UserManager <AppIdentityUser> userManager) { _context = context; _userManager = userManager; }
public ProjectMembersViewComponent(ApplContext context, UserManager <AppIdentityUser> userManager) { _context = context; _userManager = userManager; }
public ContestentsController(ApplContext appContext, IdContext idContext, ILogger <ContestentsController> logger) { _appContext = appContext; _idContext = idContext; _logger = logger; }
public UserComplaintRepository(ApplContext context) { this.DbContext = context; }
public ResultsController(ApplContext context, iResultService service) { resultService = service; _context = new UnitOfWork(); }
public AdminController(ApplContext context, UserManager <AppIdentityUser> userManager) { _context = context; _userManager = userManager; }
public TouController(ApplContext context) { _context = context; }
public ProjectLocalesViewComponent(ApplContext context) { _context = context; }
public ContestentsListViewModel(ApplContext appContext, IdContext idContext, int?id) { IQueryable a = (from c in appContext.Contestent join u in idContext.Users on c.UsersId equals u.Id.ToString() join t in appContext.Tournement.AsNoTracking() on c.TournementId equals t.Id where (c.Id == id) select new { ContestentId = c.Id, c.EnlistDate, c.UsersId, t.RegistrationEndDate, t.RegistrationStartDate, t.TournementEndDate, t.TournementStartDate, TournementName = t.Name, c.TournementId }); IQueryable <ContestentsListViewModel> b = from u in idContext.Users.AsNoTracking() join c in appContext.Contestent.AsNoTracking() on u.Id.ToString() equals c.UsersId join t in appContext.Tournement.AsNoTracking() on c.TournementId equals t.Id where c.Id == id select new ContestentsListViewModel() { ContestentId = c.Id, EnlistDate = c.EnlistDate, UsersId = c.UsersId, RegistrationEndDate = t.RegistrationEndDate, RegistrationStartDate = t.RegistrationStartDate, TournementEndDate = t.TournementEndDate, TournementStartDate = t.TournementStartDate, TournementName = t.Name, TournementId = c.TournementId }; ContestentsListViewModel d = appContext.Contestent .Where(q => q.Id == id) .Join(idContext.Users, contestent => contestent.UsersId.ToString(), users => users.Id.ToString(), (contestent, users) => new { contestent.UsersId, contestent.EnlistDate, ContestentId = contestent.Id, contestent.TournementId, users.UserName }) .Join(appContext.Tournement, contestuser => contestuser.TournementId, tournement => tournement.Id, (contestuser, tournement) => new ContestentsListViewModel() { UsersId = contestuser.UsersId, EnlistDate = contestuser.EnlistDate, ContestentId = contestuser.ContestentId, TournementId = contestuser.TournementId, UserName = contestuser.UserName, TournementName = tournement.Name, RegistrationStartDate = tournement.RegistrationStartDate, RegistrationEndDate = tournement.RegistrationEndDate, TournementStartDate = tournement.TournementStartDate, TournementEndDate = tournement.TournementEndDate }) .First <ContestentsListViewModel>(); ContestentsListViewModel e = a.Cast <ContestentsListViewModel>().First(); this.RegistrationEndDate = e.RegistrationEndDate; this.UsersId = e.UsersId; this.ContestentId = e.ContestentId; this.EnlistDate = e.EnlistDate; this.RegistrationStartDate = e.RegistrationStartDate; this.TournementEndDate = e.TournementEndDate; this.TournementId = e.TournementId; this.TournementName = e.TournementName; this.TournementStartDate = e.TournementStartDate; }
public ChatsController(ApplContext context, iChatService chatService) { _context = new UnitOfWork(); this.chatService = chatService; }
public InvitationsIndexViewComponent(ApplContext context, UserManager <AppIdentityUser> userManager) { _context = context; _userManager = userManager; }
public AnswersController(ApplContext context, IMapper mapper) { _context = new UnitOfWork(); this.mapper = mapper; }
public PhotoRepository(ApplContext context) { this.db = context; }