I am new to C#, csla and NHibernate. This might be a novice question but I didn't see a clear explanation elsewhere. Can someone please help me in understanding what is the difference between
public int Property
{
get { return GetProperty<int>(Property); }
private set { SetProperty<int>(Property, value); }
}
and
public int Property{get;set;}
CSLA implements a powerful new way of implementing properties, where you don't need to declare a field to store the property's value. The field values are managed by CSLA .NET and so are called managed fields. In the future some advanced features of CSLA .NET may be unavailable unless you use managed fields.
Syntax :
public string Name
{
get { return GetProperty<string>(NameProperty); }
set { SetProperty<string>(NameProperty, value); }
}
CSLA also supports a different syntax where you use private fields to store the values. This technique is faster than using managed fields, but requires that you declare and maintain your own fields.
Hope this gives a clear idea about the GetProperty
and SetProperty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With