using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers;

namespace App
{
    public class HomeController : Controller
    {
        private readonly IEnumerable<Type> _controllerTypes;
        public HomeController(ApplicationPartManager manager)
        {
            var feature = new ControllerFeature();
            manager.PopulateFeature(feature);
            _controllerTypes = feature.Controllers;
        }

        [HttpGet("/")]
        public string Index()
        {
            var lines = _controllerTypes.Select(it => it.Name);
            return string.Join(Environment.NewLine, lines.ToArray());
        }
    }
}
