开发者

Delete multiple records from a table using subsonic T4 templates?

开发者 https://www.devze.com 2022-12-12 04:41 出处:网络
Using templates, how can I delete multiple records from a table i开发者_StackOverflow社区n same Delete statement?Your question\'s a bit ambiguous but based on another question you\'ve posted I think y

Using templates, how can I delete multiple records from a table i开发者_StackOverflow社区n same Delete statement?


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消