Esempio n. 1
0
        public static void Main(string[] args)
        {
            var builder = new TypeScriptGenerator(new TypeScriptGeneratorOptions
            {
                EmitDocumentation = false,
                EmitComments      = true
            });

            builder
            .ExcludeType(typeof(Program))
            .AddCSType(typeof(Poco));
            //.AddCSType(typeof(TestA.Employee));
            //.AddCSType(typeof(TestA.Equipment))
            //.AddCSType(typeof(TestB.Strange<>));

            builder.Store("Test.ts");
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var builder = new TypeScriptGenerator(new TypeScriptGeneratorOptions
            {
                EmitDocumentation = false,
                EmitComments      = true
            });

            builder
            .ExcludeType(typeof(Program))
            //.AddCSType(typeof(Poco))
            .AddCSType(typeof(FakeStateImplicit))
            .AddCSType(typeof(FakeStateExplicitNumber))
            .AddCSType(typeof(FakeStateExplicitString));
            //.AddCSType(typeof(GetCookiesForWebsiteQuery));
            //.AddCSType(typeof(TestA.Employee));
            //.AddCSType(typeof(TestA.Equipment))
            //.AddCSType(typeof(TestB.Strange<>));

            builder.Store("Test.ts");

            var jsonTest = new EntityWithEnum();

            jsonTest.Name  = "Markus";
            jsonTest.State = FakeStateExplicitString.Three;

            var res = JsonConvert.SerializeObject(jsonTest);

            Console.WriteLine("Converted: " + res);

            var des = JsonConvert.DeserializeObject <EntityWithEnum>(res);

            Console.WriteLine(des.State);

            //Console.ReadLine();
        }