コード例 #1
0
        public ActionResult Delete(int id)
        {
            var response = _measurementService.Delete(id);

            TempData["IsSuccess"] = response.IsSuccess;
            TempData["Message"]   = response.Message;
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public IHttpActionResult Delete(int key)
        {
            try
            {
                if (!_MeasurementSvc.Delete(key))
                {
                    return(NotFound());
                }
                _data.SaveChanges();
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }