// GET: Home public async Task<ActionResult> Index() { var context = new ApplicationDbContext(); // DefaultConnection var store = new UserStore<CustomUser>(context); var manager = new UserManager<CustomUser>(store); var email = "*****@*****.**"; var password = "******"; var user = await manager.FindByEmailAsync(email); if (user == null) { user = new CustomUser { UserName = email, Email = email, FirstName = "Super", LastName = "Admin" }; await manager.CreateAsync(user, password); } else { user.FirstName = "Super"; user.LastName = "Admin"; await manager.UpdateAsync(user); } return Content("Hello, Index"); }
public string AddBlock(string userId, string type) { using (ApplicationDbContext db = new ApplicationDbContext()) { var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(db)); var currentUser = manager.FindById(User.Identity.GetUserId()); var blockedUser = manager.FindById(userId); if (type.Equals("Block")) { currentUser.blockedList.Add(blockedUser); //unfollow each person if there was any following UnFollow(currentUser, blockedUser); UnFollow(blockedUser, currentUser); } else //unblock user just remove him from the list { var block = currentUser.blockedList.Find(user => user.Id == blockedUser.Id); if (block != null) { currentUser.blockedList.Remove(block); } } // manager.UpdateAsync(currentUser); var store = new UserStore<ApplicationUser>(new ApplicationDbContext()); // store.Context.SaveChanges(); db.SaveChanges(); return "success"; } }
public string AddFollow(string userId, string type) { using (ApplicationDbContext db = new ApplicationDbContext()) { var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(db)); var currentUser = manager.FindById(User.Identity.GetUserId()); var followedUser = manager.FindById(userId); if (type.Equals("Follow")) { currentUser.followList.Add(followedUser); } else { UnFollow(currentUser, followedUser); } //manager.UpdateAsync(currentUser); var store = new UserStore<ApplicationUser>(new ApplicationDbContext()); //store.Context.SaveChanges(); db.SaveChanges(); return "success"; } }
public ActionResult UploadProfileImage(HttpPostedFileBase file) { if (file != null) { string fileName = Guid.NewGuid().ToString() + ".jpg"; string path = System.IO.Path.Combine( Server.MapPath("~/Images/Profile"), fileName); using (var db = new ApplicationDbContext()) { var userId = User.Identity.GetUserId(); var currentUser = db.Users.FirstOrDefault(u => u.Id == userId); if (currentUser.ProfileImageUri != null) { var success = RemoveCurrentImage(currentUser.ProfileImageUri); } currentUser.ProfileImageUri = fileName; db.Entry(currentUser).State = EntityState.Modified; db.SaveChanges(); } // file is uploaded file.SaveAs(path); } // after successfully uploading redirect the user return RedirectToAction("EditPublicProfile"); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { //Stores the Request in an Accessible object var request = filterContext.HttpContext.Request; //Generate an audit AccessAudit audit = new AccessAudit() { //Your Audit Identifier AuditID = Guid.NewGuid(), //Our Username (if available) UserName = (request.IsAuthenticated) ? filterContext.HttpContext.User.Identity.Name : "Anonymous", UserId = (request.IsAuthenticated) ? filterContext.HttpContext.User.Identity.GetUserId() : null, //The IP Address of the Request IPAddress = request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? request.UserHostAddress, //The URL that was accessed AreaAccessed = request.RawUrl, //Creates our Timestamp Timestamp = DateTime.UtcNow }; //Stores the Audit in the Database ApplicationDbContext context = new ApplicationDbContext(); context.AccessAudit.Add(audit); context.SaveChanges(); //Finishes executing the Action as normal base.OnActionExecuting(filterContext); }
public static IEnumerable<Language> GetAll() { using (ApplicationDbContext db = new ApplicationDbContext()) { return db.Languages.OrderBy(h => h.Name).ToList(); } }
public IEnumerable<CourseViewModel> Courses() { using (var ctx = new ApplicationDbContext()) { return ctx.Courses.Include(m => m.Prerequisites).ToList().Select(m => new CourseViewModel(m)); } }
protected void LogIn(object sender, EventArgs e) { if (IsValid) { var context = new ApplicationDbContext(); var signinUser = context.Users.FirstOrDefault(u => u.UserName == UserName.Text); if (signinUser!= null && !signinUser.IsDeleted) { // Validate the user password IAuthenticationManager manager = new AuthenticationIdentityManager(new IdentityStore(new ApplicationDbContext())).Authentication; IdentityResult result = manager.CheckPasswordAndSignIn(Context.GetOwinContext().Authentication, UserName.Text, Password.Text, RememberMe.Checked); if (result.Success) { OpenAuthProviders.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response); } else { FailureText.Text = result.Errors.FirstOrDefault(); ErrorMessage.Visible = true; } } else { FailureText.Text = "Please register"; ErrorMessage.Visible = true; } } }
public ActionResult Menu() { ApplicationDbContext userscontext = new ApplicationDbContext(); var userStore = new UserStore<ApplicationUser>(userscontext); var userManager = new UserManager<ApplicationUser>(userStore); var roleStore = new RoleStore<IdentityRole>(userscontext); var roleManager = new RoleManager<IdentityRole>(roleStore); if (User.Identity.IsAuthenticated) { if (userManager.IsInRole(this.User.Identity.GetUserId(), "Admin")) { return PartialView("_AdminMenuView"); } else if (userManager.IsInRole(this.User.Identity.GetUserId(), "Principal")) { return PartialView("_PrincipalenuView"); } else { return PartialView("_Student"); } } return PartialView("_Empty"); }
public CourseViewModel Course([FromUri] int ID) { using (var ctx = new ApplicationDbContext()) { return new CourseViewModel(ctx.Courses.Include(m => m.Prerequisites).Single(m => m.ID == ID)); } }
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (!ModelState.IsValid) { return View(model); } ApplicationDbContext db = new ApplicationDbContext(); var user = db.Users.Where(u => u.UserName.Equals(model.UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault(); if (user.LockoutEnabled) { return View("Lockout"); } // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, change to shouldLockout: true var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false); switch (result) { case SignInStatus.Success: return RedirectToLocal(returnUrl); case SignInStatus.LockedOut: return View("Lockout"); case SignInStatus.RequiresVerification: return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); case SignInStatus.Failure: default: ModelState.AddModelError("", "Invalid login attempt."); return View(model); } }
public BookRepository(ApplicationDbContext context, ApplicationUser user) { if (context == null) throw new ArgumentException(nameof(context)); if (user == null) throw new ArgumentException(nameof(user)); _context = context; _user = user; }
public ActionResult Create() { var db = new ApplicationDbContext(); Advertisement ad = new Advertisement(); ad.CategoryList = db.Category.ToList(); return View(ad); }
public JsonResult doesUserNameExist(string UserName) { var db = new ApplicationDbContext(); var user = db.Users.Where(c => c.UserName == UserName).FirstOrDefault(); return Json(user == null); }
public void Insert(string username) { using (var rep = new OrderRepository()) { ApplicationDbContext dbcon = new ApplicationDbContext(); OrderView model = new OrderView(); var obj = new PatientBusiness(); var shop = new ShoppingCartBusiness(); var person = dbcon.Patients.SingleOrDefault(x => x.UserName.Equals(username)); var tot = shop.ComputeTotal(username); if (tot != 0) { if (person != null) { model.FirstName = person.FirstName; model.LastName = person.LastName; } model.TotalCost = shop.ComputeTotal(username); model.Username = username; rep.Insert(ConvertToProduct(model)); } ShoppingCartBusiness biz = new ShoppingCartBusiness(); biz.UpdateCheck(username); } }
protected void ButtonEditAnswer_Click(object sender, EventArgs e) { var text = this.AnswerText.Text; if (string.IsNullOrWhiteSpace(text) || text == "<br>") { ErrorSuccessNotifier.AddErrorMessage("Answer body can't be empty"); return; } var answerId = Convert.ToInt32(Request.Params["id"]); var context = new ApplicationDbContext(); var answer = context.Answers.Find(answerId); if (answer.Text != text) { answer.Text = text; } context.SaveChanges(); ErrorSuccessNotifier.ShowAfterRedirect = true; ErrorSuccessNotifier.AddSuccessMessage("Answer edited"); Response.Redirect("~/QuestionForm.aspx?id=" + answer.Question.Id); }
protected void grdMessages_RowCommand(object sender, GridViewCommandEventArgs e) { Control control = null; switch (e.CommandName) { case "AddFromFooter": control = grdMessages.FooterRow; break; default: control = grdMessages.Controls[0].Controls[0]; break; } if (control != null) { var textBox = control.FindControl("txtMessage") as TextBox; if (textBox != null) { string message = textBox.Text; var db = new ApplicationDbContext(); db.Messages.Add(new MessageModel() { Message = message, UserId = User.Identity.GetUserId() }); db.SaveChanges(); grdMessages.DataBind(); } } }
// // GET: /Manage/Index public async Task<ActionResult> Index(ManageMessageId? message) { ApplicationDbContext db = new ApplicationDbContext(); ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." : message == ManageMessageId.Error ? "An error has occurred." : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." : ""; var userId = User.Identity.GetUserId(); var model = new IndexViewModel { HasPassword = HasPassword(), PhoneNumber = await UserManager.GetPhoneNumberAsync(userId), TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId), Logins = await UserManager.GetLoginsAsync(userId), BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId), MinutesBetweenAlerts = db.Users.Single(m => m.UserName == User.Identity.Name).MinutesBetweenAlerts, }; return View(model); }
public Prop() { //TODO: Get date and lookup to see what Football week is being played ApplicationDbContext db = new ApplicationDbContext(); var weekId = db.Week.First().Week_Id; this.Week = weekId; }
protected void Page_Load(object sender, EventArgs e) { //var manager = new AuthenticationIdentityManager(new IdentityStore(new ApplicationDbContext())); //manager.Roles.CreateRoleAsync(new Role("Moderator")); //manager.Roles.AddUserToRoleAsync("54fbcab5-d65b-47d4-b517-2eba10002e21", "186c2138-de27-42a6-94f0-8b830c2e8b9c"); var manager = new AuthenticationIdentityManager(new IdentityStore(new ApplicationDbContext())); if (!manager.Logins.HasLocalLogin(User.Identity.GetUserId())) { grdMessages.EmptyDataTemplate = null; if (grdMessages.FooterRow != null) { grdMessages.FooterRow.Visible = false; } } else { var userId = User.Identity.GetUserId(); var db = new ApplicationDbContext(); var user = db.Users.FirstOrDefault(u => u.Id == userId); if (user != null) { if (user.Roles.Any(r => r.Role.Name == "Moderator")) { grdMessages.Columns[2].Visible = true; } else if (user.Roles.Any(r => r.Role.Name == "Administrator")) { grdMessages.Columns[2].Visible = true; grdMessages.Columns[3].Visible = true; } } } }
public IPagedList<RecipeHeaderData> GetAllRecipeHeaderData(string sortBy, int pageNumber) { using (var context = new ApplicationDbContext()) { IPagedList<RecipeHeaderData> allRecipes; switch (sortBy) { case "Title": allRecipes = context.Recipes .OrderBy(r => r.Title) .Select(Recipes.SelectHeader) .ToPagedList(pageNumber, 8); break; case "PrepareTime": allRecipes = context.Recipes .OrderBy(r => r.PrepareTime) .Select(Recipes.SelectHeader) .ToPagedList(pageNumber, 8); break; default: allRecipes = context.Recipes .OrderBy(r => r.Title) .Select(Recipes.SelectHeader) .ToPagedList(pageNumber, 8); break; } return allRecipes; } }
private List<BasketType> getBasketList() { using (var db = new ApplicationDbContext()) { return db.Basket.ToList(); } }
private List<Periodo> GetPeriodsBetweenDates(DateTime start, DateTime end, ApplicationDbContext db) { List<Periodo> periods = new List<Models.Periodo>(); var result = from a in db.Periodos where (a.FechaInicio >= start && a.FechaInicio <= end) || (a.FechaFin >= start && a.FechaFin <= end) || (start >= a.FechaInicio && start <= a.FechaFin) || (end >= a.FechaInicio && end <= a.FechaFin) select a; var pActive = db.Periodos.FirstOrDefault(item => item.Activo); foreach (Periodo p in result) { if (p.FechaFin >= pActive.FechaFin) { periods.Add(p); } } //foreach (Periodo p in db.Periodos.Where(item => item.Activo)) //{ // if (!periods.Exists(item => item.ID == p.ID)) // { // periods.Add(p); // } //} return periods; }
public void RegisterTest() { using (var db = new ApplicationDbContext()) { //arrange string password = "******"; string email = "*****@*****.**"; string role = "admin"; string firstname = "Mark Joshua"; string lastname = "Abrenica"; RegisterViewModel registration = new RegisterViewModel() { Password = password, Email = email, ConfirmPassword = password, Role = role, FirstName = firstname, LastName = lastname }; //act AccountController controller = new AccountController(); bool output = controller.RegisterUser(registration); //assert Assert.IsTrue(output); } }
public void Init() { _trans = new TransactionScope(); // make connection db = new ApplicationDbContext(); //make controller controller = new ReviewController { DbContext = db }; // seed the database if empty if (db.Members.Count() == 0) { new Migrations.Configuration().SeedDebug(db); Console.WriteLine("Seeded DB"); } else { Console.WriteLine("DB Already seeded"); } Review validTestReview = new Review(); Game game = db.Games.FirstOrDefault(); Member member = db.Members.FirstOrDefault(); validTestReview.Game_Id = game.Id; validTestReview.Game = game; validTestReview.Author = member; validTestReview.Rating = 3; validTestReview.Body = "Great Game!"; validTestReview.Subject = "Review Title"; validTestReview.IsApproved = false; validTestReview.Aprover_Id = null; db.Reviews.Add(validTestReview); db.SaveChanges(); }
public ActionResult EditUserProfile(string id) { var context = new ApplicationDbContext(); var user = context.Users.Include("Profile").FirstOrDefault(u => u.UserName == id); this.ViewBag.user = user; return this.View(); }
public int ClearStatistics() { var context = new ApplicationDbContext(); context.Statistics.RemoveRange(context.Statistics); context.SaveChanges(); return context.Statistics.Count(); }
protected void ButtonSendMessage_Click(object sender, EventArgs e) { string contents = this.TextBoxMessage.Text.Trim(); if (string.IsNullOrWhiteSpace(contents)) { this.LabelErrorMessage.Text = "No message to send."; return; } using (var context = new ApplicationDbContext()) { var user = context.Users.Find(User.Identity.GetUserId()); if (user == null) { this.LabelErrorMessage.Text = "User not logged in."; return; } var newMessage = new Message { Author = user, Contents = contents, Timestamp = DateTime.Now }; context.Messages.Add(newMessage); context.SaveChanges(); Response.Redirect(Request.RawUrl); } }
public void ConfigureAuth(IAppBuilder app) { ApplicationDbContext db = new ApplicationDbContext(); app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseOpenIdConnectAuthentication( new OpenIdConnectAuthenticationOptions { ClientId = clientId, Authority = Authority, PostLogoutRedirectUri = postLogoutRedirectUri, Notifications = new OpenIdConnectAuthenticationNotifications() { // If there is a code in the OpenID Connect response, redeem it for an access token and refresh token, and store those away. AuthorizationCodeReceived = (context) => { var code = context.Code; ClientCredential credential = new ClientCredential(clientId, appKey); string signedInUserID = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value; AuthenticationContext authContext = new AuthenticationContext(Authority, new ADALTokenCache(signedInUserID)); AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode( code, new Uri(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path)), credential, graphResourceId); return Task.FromResult(0); } } }); }
public CallForPapersController(IConferenceService conferenceService, IImageUploader imageUploader, ApplicationDbContext dbContext) { _conferenceService = conferenceService; _imageUploader = imageUploader; _dbContext = dbContext; _cfpSpeakerImageContainerName = ConfigurationManager.AppSettings["Storage.Container.CallForPaper.SpeakerImages"]; }
public BaseRepository(ApplicationDbContext context) { this.context = context; }
public MunicipiosController(ApplicationDbContext context) { _context = context; }
public CoursesController(ApplicationDbContext context) { _context = context; }
/// <summary> /// Initializes a new instance of the <see cref="InputInvoiceService"/> class. /// </summary> /// <param name="context">Application database context.</param> public InputInvoiceService(ApplicationDbContext context) : base(context) { }
public RolesController(IDistributedCache distributedCache, ApplicationDbContext db, IRolesService <Roles> rolesService, IMapper mapper, IOptions <JwtSetting> jwtsetting, IHttpContextAccessor httpContextAccessor) : base(distributedCache, db, mapper, jwtsetting, httpContextAccessor) { _RolesService = rolesService; }
public ProblemsController(ApplicationDbContext context) { _context = context; }
public StudentsController() { _context = new ApplicationDbContext(); }
public GigsController() { _context = new ApplicationDbContext(); }
private IQueryable <Data.InvoiceData> GetInvoiceQuery(ApplicationDbContext context, InvoiceQuery queryObject) { IQueryable <Data.InvoiceData> query = queryObject.UserId is null ? context.Invoices : context.UserStore.Where(u => u.ApplicationUserId == queryObject.UserId).SelectMany(c => c.StoreData.Invoices); if (!queryObject.IncludeArchived) { query = query.Where(i => !i.Archived); } if (queryObject.InvoiceId != null && queryObject.InvoiceId.Length > 0) { var statusSet = queryObject.InvoiceId.ToHashSet().ToArray(); query = query.Where(i => statusSet.Contains(i.Id)); } if (queryObject.StoreId != null && queryObject.StoreId.Length > 0) { var stores = queryObject.StoreId.ToHashSet().ToArray(); query = query.Where(i => stores.Contains(i.StoreDataId)); } if (!string.IsNullOrEmpty(queryObject.TextSearch)) { var ids = new HashSet <string>(SearchInvoice(queryObject.TextSearch)).ToArray(); if (ids.Length == 0) { // Hacky way to return an empty query object. The nice way is much too elaborate: // https://stackoverflow.com/questions/33305495/how-to-return-empty-iqueryable-in-an-async-repository-method return(query.Where(x => false)); } query = query.Where(i => ids.Contains(i.Id)); } if (queryObject.StartDate != null) { query = query.Where(i => queryObject.StartDate.Value <= i.Created); } if (queryObject.EndDate != null) { query = query.Where(i => i.Created <= queryObject.EndDate.Value); } if (queryObject.OrderId != null && queryObject.OrderId.Length > 0) { var statusSet = queryObject.OrderId.ToHashSet().ToArray(); query = query.Where(i => statusSet.Contains(i.OrderId)); } if (queryObject.ItemCode != null && queryObject.ItemCode.Length > 0) { var statusSet = queryObject.ItemCode.ToHashSet().ToArray(); query = query.Where(i => statusSet.Contains(i.ItemCode)); } if (queryObject.Status != null && queryObject.Status.Length > 0) { var statusSet = queryObject.Status.ToHashSet().ToArray(); query = query.Where(i => statusSet.Contains(i.Status)); } if (queryObject.Unusual != null) { var unused = queryObject.Unusual.Value; query = query.Where(i => unused == (i.Status == "invalid" || !string.IsNullOrEmpty(i.ExceptionStatus))); } if (queryObject.ExceptionStatus != null && queryObject.ExceptionStatus.Length > 0) { var exceptionStatusSet = queryObject.ExceptionStatus.Select(s => NormalizeExceptionStatus(s)).ToHashSet().ToArray(); query = query.Where(i => exceptionStatusSet.Contains(i.ExceptionStatus)); } query = query.OrderByDescending(q => q.Created); if (queryObject.Skip != null) { query = query.Skip(queryObject.Skip.Value); } if (queryObject.Count != null) { query = query.Take(queryObject.Count.Value); } return(query); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ApplicationDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.Use((request, next) => { var es = new CultureInfo("es-CL"); System.Threading.Thread.CurrentThread.CurrentCulture = es; System.Threading.Thread.CurrentThread.CurrentUICulture = es; return(next()); }); //app.Use((stx, next) => //{ // var cultureQuery = stx.Request.Query["culture"]; // if (!string.IsNullOrWhiteSpace(cultureQuery)) // { // var culture = new CultureInfo(cultureQuery); // CultureInfo.CurrentCulture = culture; // CultureInfo.CurrentUICulture = culture; // } // else // { // var culture = new CultureInfo("sv-SE"); // CultureInfo.CurrentCulture = culture; // CultureInfo.CurrentUICulture = culture; // } // return next(); //}); //List<CultureInfo> supportedCultures = new List<CultureInfo> //{ // new CultureInfo("en-US"), // new CultureInfo("es-CL"), // new CultureInfo("es"), // new CultureInfo("sv") //}; //app.UseRequestLocalization(new RequestLocalizationOptions //{ // DefaultRequestCulture = new RequestCulture("es-CL"), // SupportedCultures = supportedCultures, // SupportedUICultures = supportedCultures //}); app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}/{slug?}"); }); SeedData.Initialize(context); }
public PaymentTypeDAL(ApplicationDbContext db, IUser user) : base(db, user) { Errors.ResetLibAndClass(GetSelfClassName()); }
public List<ProductoMasVendido> ProductoBarChart() { using (ApplicationDbContext DbModel = new ApplicationDbContext()) { var Detalles = new List<OrdersDetails>(); var Ids = new List<int>(); var VentasDelMes = DbModel.Orders.Where(x => x.DiaOrden.Month == DateTime.Now.Month).ToList(); var ProductoDelMes = new List<ProductoMasVendido>(); if (VentasDelMes.Count() > 0) { foreach (var item in VentasDelMes) { bool encontrado = false; Detalles = DbModel.OrdersDetails.Where(x => x.idOrder == item.IdOrder).ToList(); string Nombre = null; foreach (var Det in Detalles) { foreach (var lista in Ids) { if (Det.idProducto == lista) { encontrado = true; } } if (encontrado) { break; } Ids.Add(Det.idProducto); int Count = 0; var existe = DbModel.OrdersDetails.Where(x => x.idProducto == Det.idProducto).Count(); if (existe > 0) { var prod = DbModel.OrdersDetails.Where(x => x.idProducto == Det.idProducto).ToList(); foreach (var cant in prod) { Count += cant.Cantidad; } Nombre = DbModel.Productos.Find(Det.idProducto).Nombre; var PV = new ProductoMasVendido() { Cantidad = Count, Producto = Nombre }; ProductoDelMes.Add(PV); } } } return ProductoDelMes.OrderByDescending(x => x.Cantidad).Take(5).ToList(); } else { var PV = new ProductoMasVendido() { Cantidad = 0, Producto = "No se tiene registro de ningĂșn producto" }; ProductoDelMes.Add(PV); return ProductoDelMes; } } }
public async Task SeedAsync(ApplicationDbContext dbContext, IServiceProvider serviceProvider) { var roleManager = serviceProvider.GetRequiredService <RoleManager <ApplicationRole> >(); await SeedRoleAsync(roleManager, GlobalConstants.AdministratorRoleName); }
public ProjectRepository( ApplicationDbContext context, IDataChangeEventEmitter dataChangeEventEmitter) : base(context, dataChangeEventEmitter) { }
public CategoryController(ApplicationDbContext context) { _context = context; }
public DocumentsProvider(ApplicationDbContext dbContext) { this.dbContext = dbContext; }
public DriverLocationController(ApplicationDbContext context, IConfiguration config) { _context = context; _configuration = config; }
public AccountController() { this.db = new ApplicationDbContext(); this.logService = new DbLogService(); }
public CompanyRepository(ApplicationDbContext db) : base(db) { _db = db; }
public CharacterStatClusterTileService(ApplicationDbContext context, IRepository<CharacterCharacterStatClusterTile> repo) { _repo = repo; _context = context; }
public UsedPartRepository(ApplicationDbContext context) : base(context) { }
protected RepositoryBase(ApplicationDbContext context) { _context = context; }
public TokenController(ApplicationDbContext context, IOptions <AppSettings> optionsAccessor) { _context = context; _appSettings = optionsAccessor.Value; }
private MoviesController() { _context = new ApplicationDbContext(); }
public Repository(ApplicationDbContext context) { _context = context; _entities = context.Set <TEntity>(); }
public StatusRepository(ApplicationDbContext dbContext) : base(dbContext) { }
public DegreeCreditsController(ApplicationDbContext context) { _context = context; }
public ModPublishingController(ApplicationDbContext dbContext, ILogger <ModPublishingController> logger) { _dbContext = dbContext; _logger = logger; }
public GiftManager(ApplicationDbContext context, ICartManager cartManager) { _context = context; _cartManager = cartManager; }
public CategoryRepository(ApplicationDbContext db) : base(db) { _db = db; }