Exemplo n.º 1
0
        public async Task <IHttpActionResult> PutMarkerModel(int id, MarkerModel markerModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != markerModel.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MarkerModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }