Delete multiple records from a table using subsonic T4 templates?

*爱你&永不变心* 提交于 2019-12-13 06:31:59

问题


Using templates, how can I delete multiple records from a table in same Delete statement?


回答1:


Your question's a bit ambiguous but based on another question you've posted I think you're trying to delete based on a list of Ids or something similar. You can do that using a fluent query as follows:

List<int> peopleIds = new List<int> { 121, 122, 35, 4 };

new SubSonic.Query.Delete<Person>(new MyDB().Provider)
    .Where(PersonTable.IdColumn).In(peopleIds)
    .Execute();


来源:https://stackoverflow.com/questions/1792473/delete-multiple-records-from-a-table-using-subsonic-t4-templates

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