async Task <object> PerformSmartSearch(FindOrganizations req)
        {
            var smartSearchRequest = req.ConvertTo <SmartSearchQueryRequest>();
            var res = await Query.Execute(smartSearchRequest);

            return(res);
        }
 public async Task <object> Any(FindOrganizations req)
 {
     if (!string.IsNullOrEmpty(req.Id))
     {
         return(await GetById(req));
     }
     return(await PerformSmartSearch(req));
 }
        async Task <object> GetById(FindOrganizations req)
        {
            var c = await QueryById.GetById <Organization>(req.Id);

            return(c == null ? new PaginatedResult <Organization>() : new PaginatedResult <Organization>()
            {
                PageSize = 1, TotalItems = 1, CurrentPage = 0, TotalPages = 1, Data = new List <Organization>()
                {
                    c
                }
            });
        }