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)); }
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; } }