Пример #1
0
        public async Task <IActionResult> CreateScope(ScopeModel newScope)
        {
            Scope dupe = await _scopeService.Find(newScope.Name);

            if (dupe != null)
            {
                ModelState.AddModelError("FindScope", $"A scope with name {newScope.Name} already exists.");
                return(RedirectToAction("Index"));
            }

            await _scopeService.Save(newScope.IdsScope);

            return(RedirectToAction("Index"));
        }