public bool RemoveFavourite(string userName, int productId) { MyApplicationDbContext ctx = new MyApplicationDbContext(); ApplicationUser user = applicationUserManager.FindByName(userName); ctx.FavouritesList.Remove(ctx.FavouritesList.Where(p => p.UserId == user.Id && p.ProductID == productId).First()); try { ctx.SaveChanges(); return(true); } catch (DbEntityValidationException exc) { foreach (var err in exc.EntityValidationErrors) { foreach (var errrr in err.ValidationErrors) { string st = errrr.ErrorMessage; } } return(false); } }
public static void SeedHostDb(MyApplicationDbContext context) { context.SuppressAutoSetTenantId = true; // Host seed new InitialHostDbBuilder(context).Create(); // Default tenant seed (in host database). new DefaultTenantBuilder(context).Create(); new TenantRoleAndUserBuilder(context, 1).Create(); }
public StatesLaboratoriesController() { this.context = new MyApplicationDbContext(); this.service = new LaboratoriesApplicationService(this.context); }
public HostRoleAndUserCreator(MyApplicationDbContext context) { _context = context; }
public InitialHostDbBuilder(MyApplicationDbContext context) { _context = context; }
public TestInputModel(MyApplicationDbContext context) { _context = context; }
public ServiceController() { storeDB = new MyApplicationDbContext(); }
public PillarController() { storeDB = new MyApplicationDbContext(); }
public InvestorController() { storeDB = new MyApplicationDbContext(); }
public WhoWeAreService(MyApplicationDbContext context) { this.context = context; }
public ProviderController() { storeDB = new MyApplicationDbContext(); }
public EditModel(MyApplicationDbContext dbContext) { _dbContext = dbContext; }
public DefaultEditionCreator(MyApplicationDbContext context) { _context = context; }
public LaboratoryService(MyApplicationDbContext context) { this.context = context; }
public LaboratoryController() { context = new MyApplicationDbContext(); }
public MyApplicationUserStore(MyApplicationDbContext context) : base(context) { }
public DefaultLanguagesCreator(MyApplicationDbContext context) { _context = context; }
public BranchController() { storeDB = new MyApplicationDbContext(); }
public JoinTeamController() { storeDB = new MyApplicationDbContext(); }
public BillingController() { storeDB = new MyApplicationDbContext(); }
public ContactController() { storeDB = new MyApplicationDbContext(); }
public CreateModel(MyApplicationDbContext dbContext) { _dbContext = dbContext; }
public BranchesApplicationService(MyApplicationDbContext context) { this.context = context; }
public TenantRoleAndUserBuilder(MyApplicationDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, MyApplicationDbContext db) { _userManager = userManager; _signInManager = signInManager; _db = db; }
public PromotionsController() { storeDB = new MyApplicationDbContext(); }
public BranchAdministrationApplicationService(MyApplicationDbContext context) { this.context = context; }
public DefaultSettingsCreator(MyApplicationDbContext context) { _context = context; }
public DoctorsOfficeService(MyApplicationDbContext context) { this.context = context; }
public DoctorsOfficeController() { context = new MyApplicationDbContext(); service = new DoctorsOfficeService(context); }