Ejemplo n.º 1
0
        public override async Task <ListsResponse> PopulateLists(ListsRequest request, ServerCallContext context)
        {
            _logger.LogInformation("Begin grpc call ApartmentService.PopulateLists.");
            var bedrooms = await _dbContext.Bedroom?.Select(b => b.MapToGrpcBedrooms()).ToListAsync();

            var countries = await _dbContext.Country?.Select(c => c.MapToGrpcCountries()).ToListAsync();

            var furnishings = await _dbContext.Furniture?.Select(f => f.MapToGrpcFurnishings()).ToListAsync();

            var periods = await _dbContext.Period?.Select(p => p.MapToGrpcPeriods()).ToListAsync();

            var listResponse = new ListsResponse();

            listResponse.Grpcbedrooms.AddRange(bedrooms);
            listResponse.Grpccountries.AddRange(countries);
            listResponse.Grpcfurnishings.AddRange(furnishings);
            listResponse.Grpcperiods.AddRange(periods);

            return(listResponse);
        }
Ejemplo n.º 2
0
 public ListsModel Execute(ListsRequest request)
 {
     return new ListsModel {Lists = ListsOf.Lists.Keys.ToArray()};
 }
Ejemplo n.º 3
0
 public ListsModel Execute(ListsRequest request)
 {
     return(new ListsModel {
         Lists = ListsOf.Lists.Keys.ToArray()
     });
 }