标签:arp lan text context rgb entity hang net code
原文:https://blog.csdn.net/weixin_40719943/article/details/106960166
四种方式删除
var club1 = context.Clubs.Single(x => x.Name == "Club1");
//方式1
context.Clubs.Remove(club1);
//方式2
context.Remove(club1);
var club2 = context.Clubs.Single(x => x.Name == "Club2");
//方式3 删除多个
context.Clubs.RemoveRange(club1, club2);
//方式3 删除多个
context.RemoveRange(club1, club2);
//saveRange之后才会真正删除,返回被删除的个数
var count=context.SaveChanges();
EntityFramework Core入门教程-06-删除数据
标签:arp lan text context rgb entity hang net code
原文地址:https://www.cnblogs.com/springsnow/p/13404229.html