ControllerTemplateCode.cs 820 Bytes
using System.Globalization;

namespace Hh.Mes.T4
{
    public partial class ControllerTemplate
    {
        private readonly string Area;
        private readonly string TableName;
        private readonly string TitleName;
        private readonly string TableDescription;
        private readonly bool IsDetail;

        public ControllerTemplate(string area, string tableName, string description)
        {
            Area = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(area);
            TableName = tableName;
            var str = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tableName);
            TitleName = string.Join("", str.Split('_'));
            TableDescription = description;
            IsDetail = tableName.EndsWith("detail", System.StringComparison.OrdinalIgnoreCase);
        }
    }
}