public IActionResult Update([FromBody] DutyCheckAppraise model)
 {
     try
     {
         if (model == null)
         {
             return(BadRequest());
         }
         using (var db = new AllInOneContext.AllInOneContext())
         {
             db.DutyCheckAppraise.Update(model);
             db.SaveChanges();
             return(new NoContentResult());
         }
     }
     catch (DbUpdateException dbEx)
     {
         return(BadRequest(new ApplicationException {
             ErrorCode = "DBUpdate", ErrorMessage = "数据保存异常:" + dbEx.Message
         }));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(new ApplicationException {
             ErrorCode = "Unknown", ErrorMessage = ex.Message
         }));
     }
 }
        public IActionResult Get(Guid id)
        {
            using (var db = new AllInOneContext.AllInOneContext())
            {
                DutyCheckAppraise data = db.DutyCheckAppraise.Include(t => t.AppraiseICO).Include(t => t.AppraiseType).Include(t => t.Organization)
                                         .FirstOrDefault(p => p.DutyCheckAppraiseId.Equals(id));
                if (data == null)
                {
                    return(NoContent());
                }

                return(new ObjectResult(data));
            }
        }
 public IActionResult Delete(Guid id)
 {
     try
     {
         using (var db = new AllInOneContext.AllInOneContext())
         {
             DutyCheckAppraise data = db.DutyCheckAppraise.FirstOrDefault(p => p.DutyCheckAppraiseId == id);
             if (data == null)
             {
                 return(NoContent());
             }
             db.DutyCheckAppraise.Remove(data);
             db.SaveChanges();
             return(new NoContentResult());
         }
     }
     catch (System.Exception ex)
     {
         return(BadRequest(new ApplicationException {
             ErrorCode = "Unknown", ErrorMessage = ex.Message
         }));
     }
 }