public void Add(IDatabaseContext context) { if (Find(context) != null) { throw new Exception(string.Format(DataResources.DuplicateDatabaseContextKeyException, context.Key)); } DatabaseContexts.Add(context); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,IsLoggedIn,IsAdmin")] FeatureFlagUser featureFlagUser) { if (ModelState.IsValid) { _context.Add(featureFlagUser); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(featureFlagUser)); }