摘要: var groupData = context.Students // 使用GroupBy分组,依据ClassId .GroupBy(s => s.ClassId) .Select(g => new { // 拿到ClassId,由于是按ClassId分组的,因此使用Max还是Min得到的一样的 C 阅读全文
posted @ 2024-08-07 14:01 龙卷风吹毁停车场 阅读(139) 评论(0) 推荐(0)
摘要: using var transaction = context.Database.BeginTransaction(); try { // 批量添加1 context.AddRange(new List<Student>() { new Student(){ ClassId=3,Name="cc" 阅读全文
posted @ 2024-08-07 13:55 龙卷风吹毁停车场 阅读(25) 评论(0) 推荐(0)