// GET: Discover
        public async Task <ActionResult> Index(DomainType?domainType = null, SortAlgorithm?sort = null)
        {
            var options = new SearchOptions(Request.QueryString.Value, 20);

            var type      = domainType.HasValue ? domainType.Value : DomainType.Subverse;
            var sortValue = sort.HasValue ? sort.Value : SortAlgorithm.Hot;

            //Lets makes sure we don't get crazy inputs
            options.Sort  = sortValue;
            options.Count = 30;

            var q       = new QueryDomainObject(type, options);
            var results = await q.ExecuteAsync();

            var page = new PaginatedList <DomainReferenceDetails>(results, options.Page, options.Count);

            ViewBag.NavigationViewModel = new Models.ViewModels.NavigationViewModel()
            {
                Description = "Discover ",
                Name        = "No Idea",
                MenuType    = Models.ViewModels.MenuType.Discovery,
                BasePath    = null,
                Sort        = sortValue
            };
            ViewBag.DomainType = type;
            return(View(page));
        }
        public async Task Query_DomainObjects()
        {
            //just make sure sql compiles

            var options         = new SearchOptions();
            QueryDomainObject q = null;
            IEnumerable <DomainReferenceDetails> results;

            options.Sort = Domain.Models.SortAlgorithm.Hot;
            q            = new QueryDomainObject(Domain.Models.DomainType.Set, options);
            results      = await q.ExecuteAsync();

            q       = new QueryDomainObject(Domain.Models.DomainType.Subverse, options);
            results = await q.ExecuteAsync();

            //Active pattern has an additional join and group clause
            options.Sort = Domain.Models.SortAlgorithm.Active;
            q            = new QueryDomainObject(Domain.Models.DomainType.Set, options);
            results      = await q.ExecuteAsync();

            q       = new QueryDomainObject(Domain.Models.DomainType.Subverse, options);
            results = await q.ExecuteAsync();

            options.Sort = Domain.Models.SortAlgorithm.New;
            q            = new QueryDomainObject(Domain.Models.DomainType.Set, options);
            results      = await q.ExecuteAsync();

            q       = new QueryDomainObject(Domain.Models.DomainType.Subverse, options);
            results = await q.ExecuteAsync();
        }