Пример #1
0
        public async Task <ActionResult> Put(Scope _scope)
        {
            var newscope = new Models.Scope()
            {
                Id        = _scope.Id,
                ScopeName = _scope.ScopeName,
            };

            db.Entry(newscope).State = EntityState.Modified;
            await db.SaveChangesAsync();

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult> Post(Scope _scope)
        {
            var newscope = new Models.Scope()
            {
                Id        = _scope.Id,
                ScopeName = _scope.ScopeName,
            };

            db.Scopes.Add(newscope);
            await db.SaveChangesAsync();

            return(new CreatedAtRouteResult("GetScope", new { id = _scope.Id }, newscope));
        }