public override string ConfigureServices()
        {
            if (_overrideDefaultController)
            {
                return(string.Empty);
            }

            if (_template.IsNetCore2App())
            {
                return("services.AddMvc();");
            }

            return("services.AddControllers();");
        }
示例#2
0
        public override string Configuration()
        {
            if (_template.IsNetCore2App())
            {
                return("app.UseMvc();");
            }

            return(@"
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllerRoute(
        name: ""default"",
        pattern: ""{controller}/{action=Index}/{id?}"");
});");
        }
        public override string Configuration()
        {
            if (_overrideDefaultController)
            {
                return(string.Empty);
            }

            if (_template.IsNetCore2App())
            {
                return("app.UseMvc();");
            }

            return(@"
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
});");
        }