You need a property that validates its input. In C# 13 and earlier, that means writing a private backing field, a get accessor that returns it, and a set accessor that validates the value before storing it. Three moving parts for one property:
public class Greeting { private string _msg = "Hello"; public string Message { get => _msg; set => _msg = value ?? thr...Want to keep yourself up to date with the latest news from Duende Software Official Site?
Subscribe using the "Follow" button below and we provide you with customized updates, via topic or tag, that get delivered to your email address, your smartphone or on your dedicated news page on follow.it.
You can unsubscribe at any time painlessly.
Title of Duende Software Official Site: "Duende Software - Identity and Access Management for .NET"