Ejemplo n.º 1
0
        public async Task <List <AssignmentViewModel> > GetAll()
        {
            var assignmentsListCallback = await Task.FromResult(_assignmentRepository.GetAll());

            var mappedEntitiesToViewModelsList = _mapper.Map <List <Assignment>, List <AssignmentViewModel> >(assignmentsListCallback.Result);

            return(mappedEntitiesToViewModelsList);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <AssignmentInfo> > HandleAsync(GetAllAssignmentsQuery _)
        {
            var assignments = await _repository.GetAll();

            return(assignments.Select(assignment => {
                return _mapper.Map <AssignmentInfo>(assignment);
            }));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> GetAll()
        {
            var result = await _repository.GetAll();

            var response = _mapper.Map <List <AssignmentDto> >(result);

            return(Ok(response));
        }
        public void Get_Returns_List_Of_Assignments()
        {
            repo.GetAll().Returns(new List <Assignment>()
            {
                new Assignment(), new Assignment()
            });
            var result = underTest.Get();

            Assert.Equal(2, result.Value.Count());
        }
Ejemplo n.º 5
0
        public List <AssignmentModel> GetAll()
        {
            var res = assignmentRepository.GetAll();
            List <AssignmentModel> assignmentModels = new List <AssignmentModel>();

            foreach (Assignment a in res)
            {
                assignmentModels.Add(mapper.map(a));
            }
            return(assignmentModels);
        }
Ejemplo n.º 6
0
        public List <AssignmentModel> GetAll()
        {
            var assignmentList = _iAssignmentRepository.GetAll()
                                 .Select(a => a)
                                 .OrderBy(l => l.LabId)
                                 .ToList();

            IList <AssignmentModel> assignmentModelsList = new List <AssignmentModel>();

            assignmentList.ForEach(s => assignmentModelsList.Add(_iAssignmentMapper.Map(s)));

            List <AssignmentModel> modelList = assignmentModelsList as List <AssignmentModel>;

            return(modelList);
        }
Ejemplo n.º 7
0
        public List <Details> Get()
        {
            var ctx = HttpContext.Current;

            if (ctx != null)
            {
                if (ctx.Cache["CacheKey"] == null)
                {
                    My_Result = _repository.GetAll();
                    ctx.Cache.Insert("CacheKey", My_Result, null,
                                     System.Web.Caching.Cache.NoAbsoluteExpiration,
                                     TimeSpan.FromMinutes(1));
                }
            }



            My_Result = ctx.Cache["CacheKey"] as List <Details>;

            return(My_Result);
            //return _repository.GetAll();
        }
 public HeroTaskListQuery(IAssignmentRepository assignmentRepository)
 {
     Field <ListGraphType <AssignmentType> >(
         "Tasks",
         resolve: context => assignmentRepository.GetAll());
 }
 // GET: api/Assignments
 public IQueryable <Assignment> GetAssignments()
 {
     return(_assignmentRepository.GetAll());
 }
Ejemplo n.º 10
0
 public IList <Assignment> GetAll()
 {
     return(_assignmentRepository.GetAll());
 }
Ejemplo n.º 11
0
 public IEnumerable <AssignmentModel> GetAllAssignments()
 {
     return(Mapper.Map <AssignmentDto[], IEnumerable <AssignmentModel> >(assignmentRepository.GetAll().ToArray()).Select(x => x.Trim()));
 }
        public ActionResult <IEnumerable <Assignment> > Get()
        {
            var assignments = repo.GetAll().ToArray();

            return(assignments);
        }