public override async Task <KundeAllDto> GetAll(Empty request, ServerCallContext context)
        {
            List <KundeDto> temp = await ClientManager.GetAll().ConvertToDtos();

            KundeAllDto result = new KundeAllDto();

            temp.ForEach(kundeDto => result.Clients.Add(kundeDto));
            return(result);
        }
示例#2
0
        public override async Task <KundenDto> GetAll(Empty request, ServerCallContext context)
        {
            KundeManager manager      = new KundeManager();
            List <Kunde> allCustomers = await manager.GetAll();

            List <KundeDto> customerDtos = allCustomers.ConvertToDtos();
            KundenDto       customersDto = new KundenDto();

            customerDtos.ForEach(kundeDto => customersDto.Customers.Add(kundeDto));
            return(customersDto);
        }
示例#3
0
 public override async Task <KundeDtoList> GetKunden(Empty request, ServerCallContext context)
 {
     try
     {
         var response = new KundeDtoList();
         response.Items.AddRange(await _manager.GetAll().ConvertToDtos());
         return(response);
     }
     catch (Exception)
     {
         throw new RpcException(new Status(StatusCode.Internal, "Internal error occured."));
     }
 }
示例#4
0
        public override async Task <AllKunden> GetAll(Empty request, ServerCallContext context)
        {
            KundeManager manager    = new KundeManager();
            List <Kunde> kundenList = await manager.GetAll();

            AllKunden allKundenDto = new AllKunden();

            foreach (Kunde k in kundenList)
            {
                allKundenDto.Kunde.Add(k.ConvertToDto());
            }
            return(allKundenDto);
        }
 public IEnumerable <KundeDto> ReadAllKunden()
 {
     WriteActualMethod();
     return(_kundeManager.GetAll().ConvertToDtos());
 }