Beispiel #1
0
        private string GetFilterStringForPropertyVoid(PropertyVoidSearchModel searchModel)
        {
            var filterString = string.Empty;

            if (searchModel != null)
            {
                if (!string.IsNullOrWhiteSpace(searchModel.PropertyCode))
                {
                    filterString = ODataFilterConstant.Filter + $"Property/PropertyCode eq '{searchModel.PropertyCode}'";
                }
                AddPageSizeNumberAndSortingInFilterString(searchModel, ref filterString);
            }
            return(filterString);
        }
Beispiel #2
0
        public async Task <PropertyVoidSearchModel> GetPropertyVoids(PropertyVoidSearchModel model)
        {
            var url    = ODataApiUri + "/Tenant?" + GetFilterStringForPropertyVoid(model);
            var result = await GetOdataResultFromApi(url);

            var searchResultCount = 0;

            if (result.Count != null)
            {
                int.TryParse(result.Count.ToString(), out searchResultCount);
            }
            model.TotalRows = searchResultCount;
            model.PropertyVoidSearchResult.Clear();
            model.PropertyVoidSearchResult.AddRange(result.Items.Select(item => JsonConvert.DeserializeObject <PropertyVoidDto>(item.ToString())));
            return(model);
        }
Beispiel #3
0
 public async Task <PropertyVoidSearchModel> GetPropertyVoids(PropertyVoidSearchModel model)
 {
     return(await _propertyVoidApiClient.GetPropertyVoids(model));
 }