Wpf 部分类实体框架属性已更改

Wpf 部分类实体框架属性已更改,wpf,entity-framework,Wpf,Entity Framework,对于数据库优先方案,我有一个多-多关系,并使用EF作为ORM&DAL: 顾客:身份证、姓名、地址|| 产品:身份证,姓名|| CustomerProduct:CutomerID,ProductID 我向产品实体类添加了一个自定义属性,称为Isincludedforcustomer public partial class Product: EntityObject { public bool isincludedforcustomer; public bool Isincl

对于数据库优先方案,我有一个多-多关系,并使用EF作为ORM&DAL:

顾客:身份证、姓名、地址|| 产品:身份证,姓名|| CustomerProduct:CutomerID,ProductID

我向产品实体类添加了一个自定义属性,称为Isincludedforcustomer

  public partial class Product: EntityObject 
{
    public bool isincludedforcustomer;
    public bool Isincludedforcustomer
    {
        get { return isincludedforcustomer; }
        set {isincludedforcustomer= value; }
    }
选择客户后,我有一个方法来分配新属性

 IsProductinclinframe(Displayedcustomerproducts, products);

如何实现将属性更改为此属性

我通常在属性的setter中调用PropertyChanged事件

public partial class Product: EntityObject, INotifyPropertyChanged 
{
    public bool isincludedforcustomer;
    public bool Isincludedforcustomer
    {
        get { return isincludedforcustomer; }
        set 
        {
            isincludedforcustomer= value; 
            RaisePropertyChanged("Isincludedforcustomer");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    private void NotifyPropertyChanged(String info)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}

如果以下答案令人满意,请将其标记为已回答和/或投赞成票。这个社区靠它的声誉体系而繁荣。