Subsonic 未在 Add 上设置 IsLoaded?
如果是骗人的问题,抱歉,截止日期很紧,没有立即找到。
似乎当我通过 Subsonic v3 添加新记录时,它确实被添加了,但是当我尝试更新值时,更新不会发生,因为 _isLoaded 为 false。
user.username = "batman";
user.Add();
address.address1 = "1234 Anyhwere St";
address.Add();
user.AddressID = address.ID;
user.Update();
用户 iActiveRecord 的 AddressID 永远不会更新,因为在 AddressID setter 属性时 _isLoaded 似乎不为 true。
我错过了什么吗?请指教。
if dupe question sorry tight deadline and didn't find right away.
Seems when I add a new record via Subsonic v3 it does get added but then when I try to update a value the update doesn't happen as the _isLoaded is false.
user.username = "batman";
user.Add();
address.address1 = "1234 Anyhwere St";
address.Add();
user.AddressID = address.ID;
user.Update();
The AddressID of the user iActiveRecord never gets updateded as it seems the _isLoaded wasn't true at the time of the AddressID setter property.
Am I missing something? Please advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将其添加到添加后更新的位置的方法是手动使用 activerecord 类上的“SetIsLoaded”方法,
对我来说似乎有点臭,但它确实有效。
The way I got this to where it would update after an add is manually using the 'SetIsLoaded' method on the activerecord class
Seems kinda smelly to me, but it does work.