C#C
C#2y ago
LazyGuard

null!

I am receiving some infos from an API and I have to decerialize to a model
I am doing somthing like

if (response.IsSuccess) 
  //deserialize to Person
else 
  // deserialize to ProblemDetails


And in person I hava defined properties using public sting Name {get; set;} = null! Is the use of null! here a bad pratice ?
Was this page helpful?