public void Update(int id, ScopeVm scopeVm) { var entity = _passportContext.Set <Scope>().Find(id); entity.Description = scopeVm.Description; _passportContext.SaveChanges(); }
public void Create(ScopeVm scopeVm) { var entity = new Scope { Name = scopeVm.Name, Description = scopeVm.Description }; _passportContext.Set <Scope>().Add(entity); _passportContext.SaveChanges(); }
public IActionResult Create([FromBody] ScopeVm scopeVm) { _scopeRepository.Create(scopeVm); return(Ok()); }