3
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Gender", DbType="Int NOT NULL", UpdateCheck=UpdateCheck.Never)]
public int Gender
{
    get
    {
        return this._Gender;
    }
    set
    {
        if ((this._Gender != value))
        {
            this.OnGenderChanging(value);
            this.SendPropertyChanging();
            this._Gender = value;
            this.SendPropertyChanged("Gender");
            this.OnGenderChanged();
        }
    }
}

there is an attribute for update check which I set it to never. But when ever I made a small change in dbml I must set this property of this field to never again. How can I override this attribute for ever in an partial class?

Update: as an example I can change dbml connection string like this, one time for ever:

partial class DataBaseDataContext : System.Data.Linq.DataContext
{
    public DataBaseDataContext() :
        base(ConfigurationManager.ConnectionStrings["MyConnection"].ToString())
    {
        OnCreated();
    }
}
Inside Man
  • 4,194
  • 12
  • 59
  • 119

1 Answers1

2

Open the dbml file in the designer and set Update Check for the property to the desired value. Don't modify the generated files directly, it will be overwritten.

enter image description here

Jeff Mercado
  • 129,526
  • 32
  • 251
  • 272
  • sometimes I add a table to database or modify it and I need to rebuild a new dbml design, but some parts are the same and I must always set their update check to never. I need to override it one time for ever, I add an example to my question. – Inside Man Jun 14 '17 at 06:39