How should I implement TypeScript interface to define this C# models:
public class PageModel
{
public long Id { get; set; }
public string Name { get; set; }
public IDictionary<string, FieldModel> Fields { get; set; }
}
public class FieldModel
{
public long Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public string DataType { get; set; }
public string DefaultValue { get; set; }
}
If you're looking for interfaces only then:
interface PageModel {
Id: number;
Name: string;
Fields: { [key: string]: FieldModel };
}
interface FieldModel {
Id: number;
Name: string;
Type: string;
DataType: string;
DefaultValue: string;
}
Some differences:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With