I am trying to pass a value in Index of my object, it gives me an error.
System.NullReferenceException: Object reference not set to an instance of an object.
I am creating the following object with index :
RecipientInfo[] RI = new RecipientInfo[1];
RI[0].email = "email-id";
RI[0].role = RecipientRole.SIGNER;
If you want see my RecipientInfo method, providing you the method below.
public partial class RecipientInfo
{
private string emailField;
private System.Nullable<RecipientRole> roleField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
public string email
{
get { return this.emailField; }
set { this.emailField = value; }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
public System.Nullable<RecipientRole> role
{
get { return this.roleField; }
set { this.roleField = value; }
}
}
Why am I getting this error?