I have this reponse class:
public class Response
{
public bool isSuccess { get; set; }
public string source { get; set; }
public string number { get; set; }
public string message { get; set; }
}
if the response is successful i want to return only issuccess, source, number and not message. but when it fails i only want to return issuccess and message. is this possible? is there an attribute tag that can hide the objects when the value is null/empty?