Ejemplo n.º 1
0
 public IList <Assignment> GetAll()
 {
     try {
         return(_assignmentService.GetAll());
     } catch (Exception ex) {
         Log.Write(ex);
         throw;
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 4
0
 public async Task <IEnumerable <AssignmentDto> > Get()
 {
     return(await service.GetAll());
 }
Ejemplo n.º 5
0
 public async Task <AssignmentDto[]> GetAllAssignments()
 {
     return(await _assignmentService.GetAll());
 }
        public ActionResult Index()
        {
            var assignments = _assignmentService.GetAll();

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