views:

46

answers:

0

I have a Linq to SQL dbml.cs file with this in it:

[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PantsName", DbType="VarChar(248)")]
[global::System.Runtime.Serialization.DataMemberAttribute(Order=3)]
public string PantsName
{
get
{
return this._PantsName;
}
set
{
if ((this._PantsName != value))
{
    this._PantsName = value;
}
}
}

I made a new .cs file and put this in it because I want to add a Custom Attribute, but I get a build exception "The type Mydal.Pants already contains a definition for 'PantsName;". All I want to do is add Attributes to what Linq to SQL already does for some binding stuff.

I don't want to edit the dbml.cs directly because it would be blown-away next time I regen from the DB.

public partial class Pants
    {
    [MyCustomAttribute( MyBool = true )]
    public string PantsName
    {
    get
    {
    return this._PantsName;
    }
    set
    {
    if ( ( this._PantsName != value ) )
    {
        this._PantsName = value;
    }
    }
    }
    }

How can I “merge” two properties with MS-wizard-made Attributes as well as my own?

Thanks.