public IList <Assignment> GetAll()
 {
     try {
         return(_assignmentService.GetAll());
     } catch (Exception ex) {
         Log.Write(ex);
         throw;
     }
 }
 public IActionResult GetAllAssignments()
 {
     try
     {
         var result = _assignmentService.GetAll().ToList();
         return(Ok(result));
     }
     catch (Exception ex)
     {
         _logger.LogWarning(ex.Message);
         return(StatusCode(500, ex.Message));
     }
 }
        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));
        }
 public async Task <IEnumerable <AssignmentDto> > Get()
 {
     return(await service.GetAll());
 }
 public async Task <AssignmentDto[]> GetAllAssignments()
 {
     return(await _assignmentService.GetAll());
 }
        public ActionResult Index()
        {
            var assignments = _assignmentService.GetAll();

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