public async Task<IHttpActionResult> Delete(CollegeKpiView view) { var result = _service.GetRecordResult(view); if (result == null) return BadRequest("The test record does not exist!"); await _service.Delete(result); return Ok(); }
public CollegeKpi GetRecordResult(CollegeKpiView view) { var college = _collegeRepository.GetByName(view.CollegeName); if (college == null) return null; var time = view.TestTime; return _repository.GetByCollegeIdAndTime(college.Id, time); }