AJ.
AJ.

Reputation: 345

Delete multiple records from a table using subsonic T4 templates?

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

Upvotes: 0

Views: 754

Answers (1)

Adam Cooper
Adam Cooper

Reputation: 8687

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

Upvotes: 1

Related Questions