コード例 #1
0
        public void Add(IDatabaseContext context)
        {
            if (Find(context) != null)
            {
                throw new Exception(string.Format(DataResources.DuplicateDatabaseContextKeyException, context.Key));
            }

            DatabaseContexts.Add(context);
        }
コード例 #2
0
        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));
        }