For using ReadOnlyBase in 3.5, do we need to do anything different in declaring properties ie use RegisterProperty?
Any of this code changes in 3.5? Is it still the recommented way for ReadOnlyBase?
private Int32 seqnum = 0;
public Int32 Seqnum
{
get
{
return seqnum;
}
}
Thanks
Your code is fine, but doesn't leverage the authorization capabilities of CSLA .NET 2.0 and higher.
If you want the authorization capabilities you can use the 2.0-3.0 style, or the new 3.5 style:
private static PropertyInfo<int> SeqNumProperty =
RegisterProperty<int>(typeof(ThisClass), new PropertyInfo<int>("SeqNum"));
private int _seqnum = 0;
public int SeqNum
{
get { return GetProperty<int>(SeqNumProperty, _seqnum); }
}
But if you don't need authorization then your existing code is also fine.
Copyright (c) Marimer LLC