THE ANGULAR + .NET TOOLKIT / 001
Your JSON.
Both sides of the stack.
Turn one JSON sample into matching C# models and TypeScript interfaces.
Less repetitive code. More time for the interesting parts.
Local by design.Your JSON never leaves your browser.How it works ↗
01 Your JSON
Browser-local processing
02 Ready to build
#nullable enable
namespace MyApp.Models;
public sealed class ApiResponse
{
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public long Id { get; set; }
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
[global::System.Text.Json.Serialization.JsonPropertyName("email")]
public string Email { get; set; } = string.Empty;
[global::System.Text.Json.Serialization.JsonPropertyName("is_active")]
public bool IsActive { get; set; }
[global::System.Text.Json.Serialization.JsonPropertyName("address")]
public Address Address { get; set; } = new();
[global::System.Text.Json.Serialization.JsonPropertyName("projects")]
public global::System.Collections.Generic.List<ProjectsItem> Projects { get; set; } = new();
[global::System.Text.Json.Serialization.JsonPropertyName("tags")]
public global::System.Collections.Generic.List<string> Tags { get; set; } = new();
}
public sealed class Address
{
[global::System.Text.Json.Serialization.JsonPropertyName("city")]
public string City { get; set; } = string.Empty;
[global::System.Text.Json.Serialization.JsonPropertyName("country")]
public string Country { get; set; } = string.Empty;
}
public sealed class ProjectsItem
{
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
[global::System.Text.Json.Serialization.JsonPropertyName("stars")]
public long Stars { get; set; }
}
Example ready. Paste your JSON to make it yours.
Good types start with good samples 1 note
- Inferred from this sample, not a schema. Review missing fields and nullability before use.
C# root type: ApiResponse. Dates stay strings; decimals become double.