madskristensen / TypeScriptDefinitionGenerator

A Visual Studio extension
Other
85 stars 46 forks source link

Option to translate "Nullable" props in C# to "optional" props in TS #15 #23

Closed raboud closed 7 years ago

raboud commented 7 years ago

Added functionality for nullable props

` public class Child { public int? NumericValue { get; set; } public Nullable NumericValue2 { get; set; } public string TextValue { get; set; } }

public class ItemHeaderDto
{
    public int? Id { get; set; }
    public string Name { get; set; } //
    public string Description { get; set; } //
}

`

Generates

declare module server {
    interface child {
        NumericValue?: number;
        NumericValue2?: number;
        TextValue: string;
    }
    interface itemHeaderDto {
        Id?: number;
        Name: string;
        Description: string;
    }
}
raboud commented 7 years ago

any chance after this we can get the MarketPlace updated?

styfle commented 7 years ago

@raboud You are a super hero!

raboud commented 7 years ago

No Mad is the hero for creating so many awesome extensions

madskristensen commented 7 years ago

I just released it to the marketplace. Thanks for the PRs!!!

raboud commented 7 years ago

i tried to update the Settings screen shot for the new option but couldn't get a good screen shot...mine were smaller and harder to read.