如何在 Visual STudio(c#) 中使用 Subsonic 执行简单更新
我有一个非常简单的更新。根据表的 ID,我想将布尔列设置为 true。问题是我对亚音速的了解就像“漆黑”。
我已执行以下操作,但它不起作用。
new SubSonic.Update(FundReturn.Schema).Set(FundReturn.Columns.IsDeleted).EqualTo(1)
.Where(FundReturn.Columns.FundId).IsEqualTo(Convert.ToInt32(row.RecordID)).Execute();
上面的代码看起来很合乎逻辑,但实际上行不通。
我将不胜感激任何帮助
I have a very simple update.According to the ID of the table,I want to set a boolean column to true.The problem is that I my knowledge to subsonic is like 'pitch black'.
I have done the following but it does not work.
new SubSonic.Update(FundReturn.Schema).Set(FundReturn.Columns.IsDeleted).EqualTo(1)
.Where(FundReturn.Columns.FundId).IsEqualTo(Convert.ToInt32(row.RecordID)).Execute();
The above line seems very logical,however it does not work.
I would appreciate any help given
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里猜测,但不要像数据库中显示的那样将 IsDeleted 设置为“1”,而是将其设置为“true”,因为您正在使用的属性可能在生成的代码中被解释为布尔值。 SubSonic 将自动为您处理此问题以及 RecordId 转换。
Guessing here, but instead of setting IsDeleted to '1' like it would appear in the database, set it to 'true' because the property you are working with is probably interpreted as a boolean in the generated code. SubSonic will automatically handle this and the RecordId conversion for you.
哇哦……这比你想的要简单得多……
Woah there.... it's a lot simpler that you might be thinking....