Open nvirth opened 1 year ago
The following C# code:
[TsClass(AutoExportProperties = true)] public class MyBase { public bool BaseProperty1 { get; set; }; public bool BaseProperty2 { get; set; }; } [TsInterface(FlattenHierarchy = true, AutoExportProperties = true)] public class MyDescendant : MyBase { public bool DescendantProperty1 { get; set; }; public bool DescendantProperty2 { get; set; }; }
Will have the following TypeScript code generated:
interface MyBase { BaseProperty1: boolean; BaseProperty2: boolean; } /** * @todo Automatically implemented from MyBase */ class MyDescendant { BaseProperty1: boolean; // [X] Base properties are duplicated BaseProperty1: boolean; BaseProperty2: boolean; BaseProperty2: boolean; DescendantProperty1: boolean; DescendantProperty2: boolean; }
So there is a descendant C# class (TS class), and its base C# class (TS interface), and the base's properties get duplicated while code generation.
In case MyBase is Substituted instead of annotated with [TsClass], the above one works perfectly.
Substitute
[TsClass]
Nice catch! Will try to create unit test
The following C# code:
Will have the following TypeScript code generated:
So there is a descendant C# class (TS class), and its base C# class (TS interface), and the base's properties get duplicated while code generation.
In case MyBase is
Substitute
d instead of annotated with[TsClass]
, the above one works perfectly.