diff --git "a/\345\220\264\351\221\253\351\270\277/20241204\345\210\240\351\231\244\345\222\214\346\237\245\346\211\276.md" "b/\345\220\264\351\221\253\351\270\277/20241204\345\210\240\351\231\244\345\222\214\346\237\245\346\211\276.md"
new file mode 100644
index 0000000000000000000000000000000000000000..e342936bafd345516de9758ac02fcc1a28eaf07a
--- /dev/null
+++ "b/\345\220\264\351\221\253\351\270\277/20241204\345\210\240\351\231\244\345\222\214\346\237\245\346\211\276.md"
@@ -0,0 +1,253 @@
+删除操作:
+
+BlogsController.cs:
+```
+public IActionResult Delete(int id)
+ {
+ //根据传入的id,在对应的数据库表中查找对应的记录,找到则返回那个元素,找不到则返回null
+ var blog = Db.Blogs.FirstOrDefault(x => x.Id == id);
+ //如果blog为空,则提示要找的那个元素不存在,反之就显示那个元素及信息,准备删除
+ if (blog != null)
+ {
+ return View(blog);
+ }
+ return View();
+ }
+
+ [HttpPost]
+ public IActionResult DeleteConfirm(int id)
+ {
+ var blog = Db.Blogs.FirstOrDefault(x => x.Id == id);
+ if (blog != null)
+ {
+ Db.Blogs.Remove(blog);
+ }
+ return RedirectToAction("Index");
+ }
+
+```
+Delete.cshtml:
+```
+@model Blog.Models.Blogs;
+
确定要删除以下元素?
+
+
+ | 标题: |
+ @Model.Title |
+
+
+ | 内容: |
+ @Model.Content |
+
+
+ | 作者: |
+ @Model.Author |
+
+
+ |
+ @* 删除 *@
+
+ |
+
+ 取消删除
+ |
+
+
+```
+
+查询操作:
+BlogsController.cs:
+```
+public IActionResult Index(string keyword)
+ {
+ if(string.IsNullOrEmpty(keyword)){
+ return View(Db.Blogs);
+ }
+ else{
+ var list=Db.Blogs.Where(x=>x.Title.Contains(keyword)||
+ x.Content.Contains(keyword)||
+ x.Author.Contains(keyword))
+ .ToList();
+ return View(list);
+ }
+ }
+```
+SearchBlogDto.cs:
+```
+namespace Blog.Models;
+public class SearchBlogDto{
+ public string? keyword{get;set;}
+}
+```
+Index.cshtml:
+```
+@* 声明集合类型 *@
+@* @model List; *@
+
+@* @model Blog.Models.SearchBlogDto; *@
+
+
+```
+
+专项练习-Linq集成查询和Lambda表达式:
+
+基础练习:
+
+1.查询特定元素 找出数组中等于5的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6 };
+```cs
+var num = numbers.Where(x => x == 5);
+```
+2.查询特定范围的元素 找出数组中在2到8之间的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6 };
+```cs
+var num=numbers.Where(x=>x>=2&&x<=8>);
+```
+3.查询并转换元素 将数组中的每个数字乘以2。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6 };
+```cs
+var num=numbers.Where(x=>x*2)
+```
+4.查询特定属性的对象 找出所有名字以"王"开头的学生。
+
+List students = new List
+{
+ new Student {Id=1, Name = "王有才", Age = 21 },
+ new Student {Id=2, Name = "王中王", Age = 22 },
+ new Student {Id=3, Name = "张语嫣", Age = 23 },
+ new Student {Id=4, Name = "詹宇航", Age = 35 },
+ new Student {Id=5, Name = "郑雨良", Age = 26 },
+};
+```cs
+var list=students.Where(x=>x.Name.StartWith('王').ToList());
+```
+5.查询并排序 找出所有年龄大于20岁的学生,并按年龄降序排列。
+
+ List students = new List
+{
+ new Student {Id=1, Name = "王有才", Age = 21 },
+ new Student {Id=2, Name = "罗婷", Age = 21 },
+ new Student {Id=3, Name = "王中王", Age = 22 },
+ new Student {Id=4, Name = "李子柒", Age = 22 },
+ new Student {Id=5, Name = "张语嫣", Age = 23 },
+ new Student {Id=6, Name = "詹宇航", Age = 35 },
+ new Student {Id=7, Name = "郑雨良", Age = 26 },
+ new Student {Id=8, Name = "欧文", Age = 26 },
+};
+```cs
+var list = students.Where(x => x.Age > 20).OrderByDescending(x => x.Age).ToList();
+```
+6.查询并去重 找出数组中所有不重复的数字。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num=numbers.Distinct().ToArray();
+```
+7.查询第一个元素 找出数组中第一个大于3的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num=numbers.First(x=>x>3);
+```
+8.查询最后一个元素 找出数组中最后一个小于7的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }
+```cs
+var num=numbers.LastOrDefault(x=>x<7);
+```
+9.查询元素是否存在 检查数组中是否存在大于10的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Any(x => x > 10);
+
+```
+10.查询元素的计数 计算数组中大于5的元素数量。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Count(x => x > 5);
+```
+11.查询元素的总和 计算数组中所有元素的总和。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Sum();
+```
+12.查询元素的最大值 找出数组中的最大值。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Max();
+
+```
+13.查询元素的最小值 找出数组中的最小值。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Min();
+
+```
+14.查询元素的平均值 计算数组中所有元素的平均值。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+var num = numbers.Average();
+
+```
+15.查询特定条件的元素 找出数组中能被3整除的元素。
+
+int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 };
+```cs
+ var num = numbers.Where(x => x % 3 == 0);
+```
\ No newline at end of file