I have defined my struct like this:
struct Test
{
private string assayName;
public string AssayName { get; set; }
private string oldUnitName;
public string OldUnitName { get; set; }
private string newUnitName;
public string NewUnitName { get; set; }
public Test(string name, string oldValue, string newValue)
{
assayName = name;
oldUnitName = oldValue;
newUnitName = newValue;
}
}
but it gives me the following error:
"Error 13 Backing field for automatically implemented property 'EnterResults.frmApplication.Test.NewUnitName' must be fully assigned before control is returned to the caller. Consider calling the default constructor from a constructor initializer."
assayName
is the backing field forAssayName
... – Dan Jclass
, not astruct
. – Henk Holterman