亚音速 3.0.0.3 崩溃 [英] Subsonic 3.0.0.3 Crash
问题描述
运行最新版本的 SubSonic (3.0.0.3).检索单个记录、更改一个字段并调用 .Save 会导致以下代码中的空引用异常:
Running the latest version of SubSonic (3.0.0.3). Retreiving a single record, making one field change and calling .Save results in a null reference exception in the code below:
public void Update(IDataProvider provider){
public void Update(IDataProvider provider){
if(this._dirtyColumns.Count>0)
_repo.Update(this,provider);
OnSaved();
}
我创建这个异常的代码很简单:
My code to create this exception is simply:
DAL.MY_QUEUE l_l_itmEngageItem = MY__QUEUE.SingleOrDefault(x => x.id == each.id);
l_l_itmItem.date_submitted = DateTime.Now;
l_l_itmItem.Update();
有没有人有一些见解?2.0 从来没有给我一个问题.非常感谢任何帮助.
Anyone have some insight? 2.0 never gave me an issue. Any help very appreciated.
推荐答案
我遇到了完全相同的情况.我可以插入,但不能更新.
I experienced the exact same scenario. I was able to insert, but not update.
我发现原因是没有在表上设置主键.设置主键后,我就可以更新了.
The cause, I found, was that a primary key was not set on the table. Once the primary key was set, I was able to update.
这篇关于亚音速 3.0.0.3 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!