Esempio n. 1
0
        public IActionResult Ideations([FromQuery] string query)
        {
            var ideations = _ideationManager.SearchIdeations(query, Constants.AutoCompleteMinLength);

            foreach (var ideation in ideations)
            {
                ideation.Project.Platform.Tenant = $"{HttpContext.Request.Scheme}://{ideation.Project.Platform.Tenant}.{HttpContext.Request.Host}";
            }

            return(Ok(ideations));
        }
Esempio n. 2
0
        public IActionResult Search(
            [FromQuery] string qry,
            [FromServices] IProjectManager projectManager,
            [FromServices] IIdeationManager ideationManager
            )
        {
            ViewBag.Query = qry;

            var platforms = _platformManager.SearchPlatforms(qry);
            var projects  = projectManager.SearchProjects(qry);
            var ideations = ideationManager.SearchIdeations(qry);

            foreach (var platform in platforms)
            {
                platform.Tenant = $"{HttpContext.Request.Scheme}://{platform.Tenant}.{HttpContext.Request.Host}";
            }

            foreach (var project in projects)
            {
                if (!project.Platform.Tenant.Contains("http"))
                {
                    project.Platform.Tenant = $"{HttpContext.Request.Scheme}://{project.Platform.Tenant}.{HttpContext.Request.Host}";
                }
            }

            foreach (var ideation in ideations)
            {
                if (!ideation.Project.Platform.Tenant.Contains("http"))
                {
                    ideation.Project.Platform.Tenant = $"{HttpContext.Request.Scheme}://{ideation.Project.Platform.Tenant}.{HttpContext.Request.Host}";
                }
            }

            ViewBag.PlatformResults = platforms.Any() ? platforms : null;
            ViewBag.ProjectResults  = projects.Any() ? projects : null;
            ViewBag.IdeationResults = ideations.Any() ? ideations : null;

            return(View());
        }