Exemple #1
0
 public Given_A_Valid_Request()
 {
     Request = new PersonListRequest
     {
         Page = 1
     };
 }
Exemple #2
0
 public async Task GetPersonList(PersonListRequest request, IServerStreamWriter <Person> responseStream, ServerCallContext context)
 {
     LogRpc(context);
     foreach (Person person in _personRepository.GetAllPeople())
     {
         await responseStream.WriteAsync(person);
     }
 }
        public async Task <IEnumerable <PersonResource> > GetAll([FromQuery] PersonListRequest request)
        {
            var pageNumber = request.Page;

            pageNumber = pageNumber <= 0 ? 1 : pageNumber;

            IEnumerable <Person> personList = await _personListCommand.ListAsync(pageNumber);

            IEnumerable <PersonResource> personResourceList = personList.ToList().Select(p => new PersonResource {
                Id = p.Id, Name = p.Name, Email = p.Email
            });

            return(personResourceList);
        }
 public async Task GetPersonList(PersonListRequest request, IServerStreamWriter<Person> responseStream, ServerCallContext context)
 {
     LogRpc(context);
     foreach (Person person in _personRepository.GetAllPeople())
     {
         await responseStream.WriteAsync(person);
     }
 }