Simple.Data wiki 阅读 4

Deleting

All Delete[...] methods return the number of records deleted.

DeleteBy[...]

Simple.Data:

db.Users.DeleteById(1);

SQL:

DELETE FROM [Users] WHERE [Users].[Id] = @p1

Delete (using Named Arguments)

Simple.Data:

db.Users.Delete(Id: 1);

SQL:

DELETE FROM [Users] WHERE [Users].[Id] = @p1

DeleteAll

Simple.Data:

// Caution here!
db.Users.DeleteAll();

SQL:

DELETE FROM [Users]

Simple.Data:

db.Users.DeleteAll(db.Users.Age > 42);

SQL:

DELETE FROM [Users] WHERE [Age] > @p1

你可能感兴趣的:(simple)