I have the following class: -
public class Requirements { public string EventMessageUId { get; set; } public string ProjectId { get; set; } public List<Message> Message { get; set; } }
I compile it using Json: -
Requirements objRequirement = JsonObject.ToObject<Requirements>();
I wanted to check if any property of the class has any value or if null remained after the previous comparison.
For this I tried: -
bool isNull= objRequirement.GetType().GetProperties().All(p => p != null);
But during debugging, I found that the property was Null or not every time it gave true.
Please help me how I can achieve this in the Avoioding For/foreach .
source share