DbObjectSmartUpdate m_UpdateColumns Public

Dec 24, 2009 at 7:48 AM

if (memberHandler.IsBelongsTo)
                        {
                            var od = (IBelongsTo)memberHandler.GetValue(obj);
                            od.ForeignKey = long.Parse(s);
                            var ho = (ILazyLoading)memberHandler.GetValue(obj);
                            ho.Init(DbEntry.Context, memberHandler.Name);
                            if (obj is DbObjectSmartUpdate)
                            {
                              (obj as DbObjectSmartUpdate).m_InternalInit = false;
                            }

                        }

当我尝试向IBelongsTo写数据的时候,我发现m_InternalInit是internal的。

大大能否把他Public呢?要不没法设置为False,DbObjectSmartUpdate就用不了了

Dec 24, 2009 at 7:50 AM

Lephone.Data.DbEntry.Save(obj);

的时候也自动DbObjectSmartUpdate了

那个列就永远更新不到。。。

Dec 24, 2009 at 8:20 AM

sorry 源代码读错了,把m_UpdateColumns Public

Dec 24, 2009 at 8:41 AM

var od = (IBelongsTo)memberHandler.GetValue(obj);
                            od.ForeignKey = long.Parse(s);
                            var ho = (ILazyLoading)memberHandler.GetValue(obj);
                            ho.Init(DbEntry.Context, memberHandler.Name);
                            if (obj is DbObjectSmartUpdate)
                            {
                                (obj as DbObjectSmartUpdate).m_UpdateColumns.Add(memberHandler.Name, 0);
                            }

Dec 24, 2009 at 8:50 AM

- - 又读错了

 

typeof (T).GetMethod("m_ColumnUpdated", ClassHelper.AllFlag).Invoke(obj, new object[] {m.Name});

 

这句话就能解决了。

 

哎~~~

Coordinator
Dec 24, 2009 at 9:05 AM

恩,暂时先这样处理吧。

另外一个等效的写法是:

ClassHelper.CallFunction(obj, "m_ColumnUpdated", m.Name);