public IActionResult GetAll(DateTime dtStart, DateTime dtEnd) { // Assume the user is not authorized IActionResult result = Unauthorized(); try { var classes = _db.GetClassesByDateRange(dtStart, dtEnd); var dtoArr = classes.Select(x => MapToDTO(x)).ToArray(); result = Ok(dtoArr); } catch (Exception) { result = BadRequest(new { Message = "Get all classes failed." }); } return(result); }