Пример #1
0
        public async Task <IHttpActionResult> PutFee(int id, Fee fee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != fee.FeeID)
            {
                return(BadRequest());
            }

            rep.UpdateFee(fee);
            //db.Entry(fee).State = EntityState.Modified;

            try
            {
                await rep.SaveAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FeeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }