> >I believe that when you do SQL->LINQ you are able to write code in a
> >partial class and therefore hook into the part where the property is set,
[quoted text clipped - 4 lines]
> implementation ?
> It is not needed for any purpose.
From
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?
FeedbackID=290470
<quote>
The sole purpose of SendPropertyChanging() was to provide a lightweight
and performant way to detect when an object is changed so that a copy
can be created for keeping original values for use in optimistic
concurrency. Hence, we deliberately did not create event args to ensure
better performance. This is quite different from the traditional
databinding use of INotifyPropertyChanged where the property name is
provided.
</quote>

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Andrus - 09 Mar 2008 21:21 GMT
Jon,
> <quote>
> The sole purpose of SendPropertyChanging() was to provide a lightweight
[quoted text clipped - 5 lines]
> provided.
> </quote>
MS Entity framework seems to generate better code by using
ReportPropertyChanging("SocialSecurityNumber")
sample:
[EdmScalarPropertyAttribute()]
public string SocialSecurityNumber {
get { return _socialSecurityNumber; }
set {
OnSocialSecurityNumberChanging(value);
ReportPropertyChanging("SocialSecurityNumber");
_socialSecurityNumber = value;
ReportPropertyChanged("SocialSecurityNumber");
OnSocialSecurityNumberChanged();
}
}
The ReportPropertyChanging and ReportPropertyChanged methods defer to an
Entity Framework ChangeTracker object that monitors current and original
property values.
So was Microsoft changed their mind in EF ?
Why they are not consistent, implement it differently for Entity framework
!?
Andrus.
Jon Skeet [C# MVP] - 09 Mar 2008 23:12 GMT
<snip>
> So was Microsoft changed their mind in EF ?
> Why they are not consistent, implement it differently for Entity framework
> !?
Different teams implemented LINQ to SQL and the EF, as far as I'm
aware.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk