© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
6 replies
ZML

Handling Nullable Property Updates in ASP.NET

I'm creating an endpoint to update an object, specifically a Salon. The SalonUpdateRequest class has three properties that can be updated: string Name, string PhoneNumber, and string? Description (nullable).

I'm facing a dilemma regarding the Description property. If the user doesn't update it (omits it in the JSON), it defaults to null, which makes it unclear whether the user intends to remove the Description or simply doesn't want to update it.

I have two ideas on how to solve this issue, but I'd like to seek advice from more experienced individuals to choose the most sensible approach.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Authorization handling in asp.net core
C#CC# / help
4y ago
Asp.net (.net461, global.asax)
C#CC# / help
15mo ago
✅ asp.net handling image uploads.
C#CC# / help
3y ago
Nullable strings in .net 6
C#CC# / help
4y ago