示例#1
0
        public ActionResult <Users> Put([FromRoute] int usersId, [FromBody] Users updatedData)
        {
            var users = _db.Users.FirstOrDefault(user => user.Id == usersId);

            users.CompanyName = updatedData.CompanyName;
            _db.SaveChanges();
            return(updatedData);
        }
示例#2
0
 public ActionResult Post([FromBody] Models.Inventories inventory)
 {
     _db.Inventories.Add(inventory);
     _db.SaveChanges();
     return(Ok(inventory));
 }
示例#3
0
 public ActionResult Post([FromBody] Models.Items item)
 {
     _db.Items.Add(item);
     _db.SaveChanges();
     return(Ok(item));
 }
示例#4
0
 public ActionResult Post([FromBody] Models.Reports report)
 {
     _db.Reports.Add(report);
     _db.SaveChanges();
     return(Ok(report));
 }