public static string GetTypeScriptBuilderPoco(this IEnumerable <Type> types)
        {
            var scripter = new TypeScriptGenerator();

            foreach (var type in types)
            {
                scripter.AddCSType(type);
            }
            return(scripter.ToString());
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var
                builder = new TypeScriptGenerator(new TypeScriptGeneratorOptions
            {
                EmitComments = true
            }).ExcludeType(typeof(Program));

            builder
            .AddCSType(typeof(TestA.Employee))
            .AddCSType(typeof(TestA.Equipment))
            .AddCSType(typeof(TestB.Strange <>));

            builder.Store("Test.ts");
        }
        public void Generate()
        {
            var ts = new TypeScriptGenerator();

            ts.AddCSType(typeof(Models.Requests.AlleTodos));

            // Assembly.GetAssembly(typeof(Program))
            //     .GetTypes()
            //     .Where(t => t.IsClass && t.Namespace == "WebAPI.Models")
            //     .ToList()
            //     .ForEach(t => ts.AddCSType(t));

            // ts.ExcludeType(typeof(ApplicationUser));

            ts.Store("../../../Helpers/Server.ts");
        }
        public static string GetTypeScriptBuilderPoco(this Type type)
        {
            var scripter = new TypeScriptGenerator();

            return(scripter.AddCSType(type).ToString());
        }