-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
FeatureNew featureNew feature
Description
Is your feature request related to a problem? Please describe.
PropertyChanged is raised even if the property value has not changed.
This is a simple generated proxy
internal partial class Foo : Microsoft.OData.Client.BaseEntityType, System.ComponentModel.INotifyPropertyChanged
{
public virtual string Name
{
get
{
return this._Name;
}
set
{
this.OnNameChanging(value);
this._Name = value;
this.OnNameChanged();
this.OnPropertyChanged("Name");
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private string _Name;
partial void OnNameChanging(string value);
partial void OnNameChanged();
}
Every time Foo.Name is set, the property change event is raised, even if the value hasn't actually changed. This may lead to SaveChangesAsync(SaveChangesOptions.PostOnlySetProperties) sending properties that haven't actually changed
Describe the solution you'd like
Raise property changed only if value changed.
internal partial class Foo : Microsoft.OData.Client.BaseEntityType, System.ComponentModel.INotifyPropertyChanged
{
public virtual string Name
{
get
{
return this._Name;
}
set
{
if (this.Name == value)
{
return;
}
this.OnNameChanging(value);
this._Name = value;
this.OnNameChanged();
this.OnPropertyChanged("Name");
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private string _Name;
partial void OnNameChanging(string value);
partial void OnNameChanged();
}
Metadata
Metadata
Assignees
Labels
FeatureNew featureNew feature