Esempio n. 1
0
        public IActionResult Update(long id, CreateUpdateGroup model)
        {
            var group = db.Groups.First(s => s.Id == id);

            group.Name = model.Name;

            db.Update(group);
            db.SaveChanges();

            return(Ok(group));
        }
Esempio n. 2
0
        public IActionResult Create(CreateUpdateGroup model)
        {
            var group = new Group()
            {
                Name = model.Name
            };

            db.Add(group);
            db.SaveChanges();

            return(Ok(group));
        }