예제 #1
0
 public IList <Assignment> GetAll()
 {
     try {
         return(_assignmentService.GetAll());
     } catch (Exception ex) {
         Log.Write(ex);
         throw;
     }
 }
예제 #2
0
 public IActionResult GetAllAssignments()
 {
     try
     {
         var result = _assignmentService.GetAll().ToList();
         return(Ok(result));
     }
     catch (Exception ex)
     {
         _logger.LogWarning(ex.Message);
         return(StatusCode(500, ex.Message));
     }
 }
예제 #3
0
        public HttpResponseMessage GetAll()
        {
            var assignmentModelList = _assignmentService.GetAll();

            if (assignmentModelList.Count == 0)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            List <AssignmentAPIModel> assignmentAPIModelList = new List <AssignmentAPIModel>();

            foreach (AssignmentModel assignment in assignmentModelList)
            {
                assignmentAPIModelList.Add(_assignmentAPIMapper.Map(assignment));
            }

            return(Request.CreateResponse(HttpStatusCode.Created, assignmentAPIModelList));
        }
예제 #4
0
 public async Task <IEnumerable <AssignmentDto> > Get()
 {
     return(await service.GetAll());
 }
예제 #5
0
 public async Task <AssignmentDto[]> GetAllAssignments()
 {
     return(await _assignmentService.GetAll());
 }
        public ActionResult Index()
        {
            var assignments = _assignmentService.GetAll();

            return(View(assignments.ToList()));
        }
예제 #7
0
 public async Task <IActionResult> GetAll(string search = "")
 {
     return(Ok(await _assignmentService.GetAll(search)));
 }
 public IEnumerable <AssignmentModel> Get()
 {
     return(assignmentService.GetAll());
 }