I’m suddenly stuck. I defined an object:
public class AddResult
{
public AddResult(string id, bool success)
{
this.ID = id;
this.Success = success;
}
public string ID { get; set; }
public bool Success { get; set; }
public string ErrorMessage { get; set; }
}
I want to return this object in another method.
public AddResult Load(string userName, string password)
{
// validate
if(userName = "")
{
AddResult.ErrorMessage = "wrong";
AddResult.ID = "";
}
// want to return object AddResult
}
The intellisense is not working for AddResult.ID etc, I know something is wrong but need your advice.
You need to instantiate an object of the class
AddResult, your code should look like this: