From 98f3ae442aa5ff0dc1ff279bc65eb9c9c2c6f52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=99=E7=82=9C=E5=BB=B7?= <1160093753@qq.com> Date: Sun, 15 Dec 2024 21:26:36 +0800 Subject: [PATCH] 35 --- .../20241209.md" | 64 +++++++++++++++++++ .../20241212.md" | 28 ++++++++ 2 files changed, 92 insertions(+) create mode 100644 "\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241209.md" create mode 100644 "\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241212.md" diff --git "a/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241209.md" "b/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241209.md" new file mode 100644 index 0000000..ac8513d --- /dev/null +++ "b/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241209.md" @@ -0,0 +1,64 @@ +# js删除功能实现代码的js +``` + +``` + +# 链接数据库的控制台 +控制台名`BlogDbContext` +``` + +public class BlogDbContext : DbContext +{ + + public DbSet Blogs { get; set; } = null!; + + + // The following configures EF to create a Sqlite database file in the + // special "local" folder for your platform. + protected override void OnConfiguring(DbContextOptionsBuilder options) + => options.UseSqlServer($"Server=SK-20240829OFAU\\SQLEXPRESS;database=TestBlogData;uid=sa;pwd=123456;TrustServerCertificate=True;"); +} +``` \ No newline at end of file diff --git "a/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241212.md" "b/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241212.md" new file mode 100644 index 0000000..e27f1db --- /dev/null +++ "b/\351\230\231\347\202\234\345\273\267/\350\257\276\345\240\202\347\254\224\350\256\260/20241212.md" @@ -0,0 +1,28 @@ +检索元素的子集以生成新序列,而不修改各个元素。 然后,查询可能以各种方式对返回的序列进行排序或分组,如下面的示例所示(假定 scores 是 int[]): +``` +IEnumerable highScoresQuery = + from score in scores + where score > 80 + orderby score descending + select score; +``` +下面的代码示例演示一个简单查询表达式,它具有一个数据源、一个筛选子句、一个排序子句并且不转换源元素。 该查询以 select 子句结尾。 +``` +// Data source. +int[] scores = [90, 71, 82, 93, 75, 82]; + +// Query Expression. +IEnumerable scoreQuery = //query variable + from score in scores //required + where score > 80 // optional + orderby score descending // optional + select score; //must end with select or group + +// Execute the query to produce the results +foreach (var testScore in scoreQuery) +{ + Console.WriteLine(testScore); +} + +// Output: 93 90 82 82 +``` \ No newline at end of file -- Gitee