📜  entity.delete - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:49.730000             🧑  作者: Mango

代码示例1
var itemToRemove = Context.Employ.SingleOrDefault(x => x.id == 1); //returns a single item.

if (itemToRemove != null) {
    Context.Employ.Remove(itemToRemove);
    Context.SaveChanges();
}