public IHttpActionResult Patch([FromODataUri] string key, Delta <DeathRecordEntity> patch)
        {
            DeathRecordService service = new DeathRecordService();
            object             id;

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else if (patch.GetChangedPropertyNames().Contains("DeathRecordID") && patch.TryGetPropertyValue("DeathRecordID", out id) && (string)id != key)
            {
                return(BadRequest("The key from the url must match the key of the entity in the body"));
            }

            try
            {
                var query = service.GetEntity(key.ToString());
                patch.Patch(query);
                service.UpdateEntity(query);
                return(Updated(query));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
 /// <summary>
 /// 更新数据,幂等
 /// </summary>
 /// <param name="key"></param>
 /// <param name="model"></param>
 public IHttpActionResult Put([FromODataUri] string key, DeathRecordEntity model)
 {
     try
     {
         DeathRecordService service = new DeathRecordService();
         if (service.UpdateEntity(model) > 0)
         {
             return(Ok(true));
         }
         else
         {
             return(Ok(false));
         }
     }
     catch (Exception)
     {
         return(Ok(false));
     }
 }