You are trying to access members in the directly opposite way; no wonder it cannot work. Your public member is
_Status
(property), not
status
(a private field, a backing field for
_Status
. So access it by
_Status
, not
status
, only give the members nice names, without violation of (good) Microsoft naming conventions ('_' is not recommended).
Also, you can use auto-implemented properties instead. Something like:
public string Status { get; private set; }
or
public string Status { get; set; }
What else? Well, using
string
type for status is a really, really bad idea. Totally unsupportable, especially when you compare the value with a
immediate constant like "success". Imagine you misspell it. A compiler won't help you to detect the problem. Imagine you changes some of the values. Same thing. Very, very unsupportable code. Consider using enumeration types.
More generally, the trend to use strings representing data instead of data itself is a very destructive fallacy of many beginners these days. Just think about it.
—SA