public async Task <IEnumerable <AssignmentInfo> > HandleAsync(GetAllAssignmentsQuery _) { var assignments = await _repository.GetAll(); return(assignments.Select(assignment => { return _mapper.Map <AssignmentInfo>(assignment); })); }
public async Task <ActionResult> Get() { var query = new GetAllAssignmentsQuery { }; var assignments = await _queryHandler.HandleAsync(query); return(Ok(assignments)); }