Subsonic 3 Save() then Update()?

混江龙づ霸主 提交于 2019-12-01 01:48:45

I faced the same problem with that :

po oPo = new po();

oPo.name ="test";

oPo.save(); //till now it works.

oPo.name = "test2";

oPo.save(); //not really working, it's not saving the data since isLoaded is set to false and the columns are not considered dirty.

it's a bug in the ActiveRecord.tt for version 3.0.0.3.

In the method public void Add(IDataProvider provider) immediately after SetIsNew(false); there should be : SetIsLoaded(true);

the reason why the save is not working the second time is because the object can't get dirty if it is not loaded. By adding the SetIsLoaded(true) in the ActiveRecord.tt, when you are going to do run custom tool, it's gonna regenerate the .cs perfectly.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!