예제 #1
0
        public IActionResult DeleteConfirmed(int id)
        {
            try
            {
                _measurementRepository.DeleteMeasurement(id);
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.
                ModelState.AddModelError("", "Delete failed. Try again, and if the problem persists " +
                                         "see your system administrator.");
            }

            return(RedirectToAction("Index"));
        }
예제 #2
0
 public IActionResult DeleteMeasurement([FromRoute] long id)
 {
     _measurementRepository.DeleteMeasurement(id, HttpContext.User.Identity.Name);
     return(StatusCode(200, new { statusCode = 200, message = "deleted" }));
 }
예제 #3
0
 public void DeleteMeasurement(string userId, int measurementId)
 {
     _repository.DeleteMeasurement(userId, measurementId);
 }