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); }
public async Task <IEnumerable <AssignmentInfo> > HandleAsync(GetAllAssignmentsQuery _) { var assignments = await _repository.GetAll(); return(assignments.Select(assignment => { return _mapper.Map <AssignmentInfo>(assignment); })); }
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()); }
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); }
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); }
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()); }
public IList <Assignment> GetAll() { return(_assignmentRepository.GetAll()); }
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); }