public GetFeatureOwnersQueryResult Retrieve(GetFeatureOwnersQuery query) { //TODO: Change to pageable query //ICollection<User> users = this.ReadRepository.All(); ICollection <User> users = this.GetUsersMock(query); GetFeatureOwnersQueryResult result = new GetFeatureOwnersQueryResult(users); return(result); }
private GetFeatureOwnersQuery SetQueryDispatcher() { GetFeatureOwnersQuery query = new GetFeatureOwnersQuery(0, 1, "Name", SortDirection.Ascending); ICollection <User> users = GetUsers(); GetFeatureOwnersQueryResult results = new GetFeatureOwnersQueryResult(users); this.QueryDispatch.Dispatch <GetFeatureOwnersQuery, GetFeatureOwnersQueryResult, User>(query).ReturnsForAnyArgs(results); return(query); }
//TODO: Change to only return users with an owner role. public ICollection <FeatureOwnerVm> GetFeatureOwners(GetFeatureOwnersQuery query) { if (query == null) { throw new ArgumentNullException(string.Format(MessagesModel.NullValueError, "query")); } ICollection <FeatureOwnerVm> owners = new List <FeatureOwnerVm>(); GetFeatureOwnersQueryResult results = this.queryDispatcher.Dispatch <GetFeatureOwnersQuery, GetFeatureOwnersQueryResult, User>(query); foreach (var user in results.Owners) { FeatureOwnerVm owner = FeatureModelHelper.ResultToFeatureOwnerVm(user); owners.Add(owner); } return(owners); }