I am pretty sure that only the parameterless versions of those methods were deprecated.
They relied on a Stack walk that proved to be unreliable.
Since I use Codesmith I always used the version where you passed in the property name as a String. That is the recommended step to take if you want to keep the upgrade simple.
Alternatively, you can use the new Property constructs that Rocky is providing that use 30% less code and are automatically managed by CSLA. I have not had time to dig into them yet and they have not been proven to work in all scenarios yet. I'm not saying they don't work - it is just that there is no historical data from their use in production applications yet. So I think that when I upgrade I will use the older style properties until there is more feedback.
Joe
So the way it should look is:
private int _id;
public int Id
{
get
{
CanReadProperty("Id");
return _id;
}
set
{
CanWriteProperty("Id");
if(....
{
_id = value;
PropertyChanged("Id");
}
}
}
Not quite. You need another parameter to throw an
exception if rights check fails.
private int _id;
public int Id
{
get
{
CanReadProperty("Id",
true);
return
_id;
}
set
{
CanWriteProperty("Id",
true);
if(....
{
_id
= value;
PropertyChanged("Id");
}
}
}
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: MrPogo
[mailto:cslanet@lhotka.net]
Sent: Friday, April 11, 2008 11:18 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] 3.5 Changes
So the way it should look is:
private int _id;
public int Id
{
get
{
CanReadProperty("Id");
return
_id;
}
set
{
CanWriteProperty("Id");
if(....
{
_id
= value;
PropertyChanged("Id");
}
}
}
_state = value
Copyright (c) Marimer LLC