JSON इनपुट
जनरेट किया गया C#
अपने .NET projects के लिए strongly-typed C# classes और records जेनरेट करने हेतु JSON data दर्ज करें
Classes, records, DTOs और nullable reference types के साथ properties
JSON से .NET और ASP.NET Core के लिए strongly-typed C# classes, records और DTO models जेनरेट करें
अपने .NET projects के लिए strongly-typed C# classes और records जेनरेट करने हेतु JSON data दर्ज करें
Classes, records, DTOs और nullable reference types के साथ properties
ASP.NET कोर प्रोजेक्ट और .NET एप्लिकेशन के लिए JSON टूल्स से C# डिस्प्ले या रिकॉर्ड बनाने के लिए इस JSON से C# आर्किटेक्चर का उपयोग करें।
चरण 1 - एक JSON नमूना पेस्ट
Import का उपयोग करें।चरण 2 - C# वर्ग विकल्प चुनें
Class Name और Namespace सेट करें।System.Text.Json या Newtonsoft.Json) चुनें।string? और इसी तरह की अन्य परिकल्पनाएँ हो सकती हैं।चरण 3 - जनरेट किए गए कोड की समीक्षा करें
Root Type Name, नल हैंडलिंग और फ्रेमवर्क जैसे विकल्प बदलें।चरण 4 - .NET में शामिल किये गए DTO का उपयोग
चरण 5 - कॉपी करें या डाउनलोड करें
शीघ्र सुझाव
[JsonPropertyName]/[JsonProperty] का उपयोग करें।// JSON आर्किटेक्चर
{
"id": 123,
"name": "Maeve Winters",
"email": "[email protected]",
"active": true,
"roles": ["admin", "editor"],
"metadata": { "plan": "pro" },
"createdAt": "2024-03-01T10:15:00Z",
"score": 99.5,
"notes": null
}
// Generated C# DTOs (simplified)
public class Metadata
{
public string Plan { get; set; } = string.Empty;
}
public class Root
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Email { get; set; }
public bool Active { get; set; }
public List<string> Roles { get; set; } = new();
public Metadata Metadata { get; set; } = new();
public DateTime CreatedAt { get; set; }
public double Score { get; set; }
public object? Notes { get; set; }
}अधिक JSON और स्कॉच टूल संकेतक जो इस JSON से C# निर्माण के साथ शानदार काम करते हैं।
स्थिर C# क्लास और रिकॉर्ड्स को JSON उदाहरणों और JSON स्कॉच में स्केल किया गया।
फ़ोर्ट पेलोड को मान्य करने के लिए JSON कैटलॉग से JSON स्कॉशिया को आकर्षित करें।
रनटाइम से बचने के लिए C# DTOs उत्पन्न करने से पहले JSON को संकलित करें और मान्य करें।
जब आप फ्रंटएंड निवेशकों के पास भी हों तो टाइप करें।
Generator C# classes और C# 9+ records (properties के साथ) बनाता है, JSON.NET और System.Text.Json attributes support करता है, और modern .NET naming conventions के अनुसार proper namespaces रखता है।
हाँ! 'Record' framework चुनें ताकि modern C# records generate हों जिनमें immutable properties होती हैं—ये DTOs, API contracts और value types के लिए ideal हैं।
Generator Newtonsoft.Json और System.Text.Json दोनों के attributes support करता है ताकि custom property names, null handling और flexible configuration के साथ सही serialization/deserialization हो सके।
Generator उन properties के लिए nullable annotations (object?) जोड़ता है जो null हो सकती हैं—यह modern C# nullable reference types conventions के अनुसार है और optional JSON fields को safely map करने में मदद करता है।
हाँ। JSON से C# code ASP.NET Core controllers, minimal APIs, Blazor components और किसी भी .NET application में अच्छी तरह काम करता है जहाँ JSON payloads के लिए strongly-typed models चाहिए हों।
हाँ, JSON Swiss का JSON से C# generator browser में मुफ्त है। आप JSON paste करके, options configure करके, बिना कोई tool/extension install किए C# code generate कर सकते/सकती हैं।