Ejemplo n.º 1
0
        public IActionResult Platforms([FromQuery] string query)
        {
            var platforms = _platformManager.SearchPlatforms(query, Constants.AutoCompleteMinLength);

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

            return(Ok(platforms));
        }
Ejemplo 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());
        }