
JSON Serialization
System.Text.Json, JsonSerializer, custom converters, naming policies, null handling
1What is the main namespace for JSON serialization in modern .NET?
What is the main namespace for JSON serialization in modern .NET?
Cevap
System.Text.Json is the official namespace for JSON serialization in .NET Core 3.0+. It progressively replaces Newtonsoft.Json (Json.NET) as it is more performant, integrated into the framework and optimized for modern scenarios. Newtonsoft.Json remains available via NuGet for backward compatibility or advanced features not available in System.Text.Json.
2Which method to use to serialize a C# object to a JSON string?
Which method to use to serialize a C# object to a JSON string?
Cevap
JsonSerializer.Serialize converts a C# object to a JSON string. This static method accepts the object to serialize and optionally JsonSerializerOptions to customize behavior. Serialize returns a string, while SerializeToUtf8Bytes returns a byte[] to optimize performance by avoiding string allocation.
3What is the default naming convention of System.Text.Json for JSON properties?
What is the default naming convention of System.Text.Json for JSON properties?
Cevap
By default, System.Text.Json preserves exactly the C# property names (case-sensitive PascalCase). If a C# property is named UserName, the JSON will contain UserName. To get camelCase (userName), configure JsonSerializerOptions with PropertyNamingPolicy = JsonNamingPolicy.CamelCase. This differs from Newtonsoft.Json which uses camelCase by default.
How to deserialize a JSON string into a typed C# object?
Which attribute to use to ignore a property during JSON serialization?
+17 mülakat soruları
Diğer .NET mülakat konuları
C# Basics
LINQ & Delegates
C# Language Essentials
ASP.NET Core Fundamentals
ASP.NET Core Request Lifecycle
Configuration & Settings
Application Lifecycle
Dependency Injection
Entity Framework Core
Minimal APIs
Web API Development
Async in ASP.NET Core
Authentication & Authorization
HttpClient & Networking
Entity Framework Core Advanced
C# Advanced Features
Clean Architecture
Logging, Monitoring & Observability
Unit Testing & xUnit
Integration Testing
Docker & Containerization
NuGet Package Management
Memory Management & GC
Reactive Programming
Async/await & Patterns
.NET Design Patterns
Performance Optimization
Security & Best Practices
SignalR & Real-time
Microservices Architecture
Bir sonraki mülakatın için .NET'de uzmanlaş
Tüm sorulara, flashcards'a, teknik testlere, code review alıştırmalarına ve mülakat simülatörlerine eriş.
Ücretsiz başla