Esempio n. 1
0
        public IActionResult Put(long id, [FromBody] Division division)
        {
            if (division == null)
            {
                return(BadRequest());
            }
            if (!db.Divisions.Any(x => x.Id == division.Id))
            {
                return(NotFound());
            }

            division.DateTime = DateTime.Now;
            db.Update(division);
            db.SaveChanges();
            return(Ok(division));
        }
Esempio n. 2
0
        public IActionResult Put(long id, [FromBody] Realtor realtor)
        {
            if (realtor == null)
            {
                return(BadRequest());
            }
            if (!db.Realtors.Any(x => x.Id == realtor.Id))
            {
                return(NotFound());
            }

            realtor.DateTime = DateTime.Now;
            db.Update(realtor);
            db.SaveChanges();
            return(Ok(realtor));
        }