79529617

Date: 2025-03-23 20:14:42
Score: 0.5
Natty:
Report link
public class Person
{
    public string? Name { get; set; }
    public void SetName(string value) { Name = value; }
}

Then it's used like this. If the reference to person is null it will skip it.

Person person = null;
person?.SetName("John Doe");
Console.WriteLine(person?.Name);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Charles Henington