示例#1
0
        public override Task <RealtyListResponse> GetRealtyList(RealtyListRequest request, ServerCallContext context)
        {
            var result = _realtyService.GetRealtyList();

            var response = new RealtyListResponse();

            response.Items.AddRange(result);

            return(Task.FromResult(response));
        }
示例#2
0
        public override async Task <RealtyListResponse> GetRealtyList(RealtyListRequest request, ServerCallContext context)
        {
            try
            {
                var list = _realtyRepository
                           .ListByName((RealtyTypeEntity)request.Type)
                           .Select(x => _mapper.Map <RealtyAd>(x)).ToList();

                var result = new RealtyListResponse
                {
                    Message = { list }
                };
                return(result);
            }catch (Exception ex)
            {
                throw;
            }
        }