Model.Save()、DbEntry.Update()执行不成功。不生成Sql。不抛出异常。

Topics: User Forum
Mar 31, 2014 at 10:23 AM
code:
var entity = PlanInfoEntryModel.FindById(9);
        entity.SupervisionContext = "234234";
        entity.Save();
        DbEntry.Save(entity);
        DbEntry.Update(entity);
ConsoleLog:
Trace,,SQL,SELECT [Id],[ColGuid],[SupervisionType],[SupervisionContext],[CreateTime],[PlanState],[PlanRember],[SupervisionTime],[PlanIsImport] FROM [PlanInfo] WHERE [Id] = @Id_0;
<Text><60>(@Id_0=9:Int64),
程序“[6604] MineMonitoring.vshost.exe: 托管(v4.0.30319)”已退出,返回值为 0 (0x0)。
Mar 31, 2014 at 4:24 PM
属性问题,找到原因了。
但是:
    /// <summary>
    /// 监察内容
    /// </summary>
    [Length(255)]
    [AllowNull]
    [DbColumn("SupervisionContext")]
    public string SupervisionContext
    {
        get { return supervisionContext; }
        set
        {
            supervisionContext = value;
            common.RaisePropertyChanged("SupervisionContext");
        }
    }
因为我用到了INotifyPropertyChanged接口,需要在Set时候通知属性已改变。如果保证这个dbentry不被忽略?