LINQ-to-SQL class doesn't implement INotifyPropertyChanging & INotifyPropertyChanged if pulling from

Posted by Traples on Stack Overflow See other posts from Stack Overflow or by Traples
Published on 2010-05-13T20:39:30Z Indexed on 2010/05/13 20:44 UTC
Read the original article Hit count: 223

Filed under:
|
|
|

I modified my data source in my LINQ-to-SQL class (by the old delete and drag back in method), and was surprised to see the INotifyPropertyChanging & INotifyPropertyChanged interfaces no longer implemented in the generated classes (MyDb.designer.cs).

The methods for the individual fields went from looking like this...

[Column(Storage="_Size", DbType="NVarChar(100)")]
public string Size
{
    get
    {
        return this._Size;
    }
    set
    {
        if ((this._Size != value))
        {
            this.OnSizeChanging(value);
            this.SendPropertyChanging();
            this._Size = value;
            this.SendPropertyChanged("Size");
            this.OnSizeChanged();
        }
    }
}

To looking like this...

[Column(Storage="_Size", DbType="NVarChar(100)")]
public string Size
{
    get
    {
        return this._Size;
    }
    set
    {
        if ((this._Size != value))
        {
            this._Size = value;
        }
    }
}

Any ideas on why this happens and how it will affect my application?

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about LINQ