Esempio n. 1
0
        public IHttpActionResult PutProjectViewModel(int id, ProjectViewModel projectviewmodel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != projectviewmodel.ProjectID)
            {
                return(BadRequest());
            }

            db.Entry(projectviewmodel).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProjectViewModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        // PUT api/TimeSheets/5
        public IHttpActionResult PutTimeSheet(int id, TimeSheetViewModel timesheet)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != timesheet.TimeSheetID)
            {
                return(BadRequest());
            }

            db.Entry(timesheet).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TimeSheetExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
 public void Alterar(Time time)
 {
     _context.Entry(time).State = EntityState.Modified;
 }
Esempio n. 4
0
 public void Alterar(Jogador jogador)
 {
     _context.Entry(jogador).State = EntityState.Modified;
 }