I have a class library project. I have a property there like below. It’s not a read only property
private Int32 ABC ;
public Int32 ABCD
{
set
{
this.ABC = value;
}
get
{
return this.ABC;
}
}
My question is, Is it necessary to declare the private variable for the same and the getter / setter ?
EDIT
I mean could it be like below ?
public Int32 ABCD {}
Automatic property declarations require the
get; set;statements in the braces (which is what you had in your original question):An empty property block isn’t valid.