I found a method, but it is not complete. I wrote a T4 file as follows:
<#
// Define your model types
var models = new string[] { "Academic", "Ostad", "Course" };
#>
using Core.Interfaces;
using DataAccessLibrary.Models;
using Microsoft.AspNetCore.Mvc;
namespace Snapp.site.Controllers
{
<#
foreach (var model in models)
{
#>
public class <#= model #>Controller : GenericController<<#= model #>>
{
public <#= model #>Controller(IRepository<<#= model #>> repository) : base(repository) { }
}
<#
} // Closing foreach loop
#>
}
But I can't dynamically generate the models array.