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 0000000000000000000000000000000000000000..ac8513d594bfabc5eadb47327aac81ebc8aa262d --- /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 0000000000000000000000000000000000000000..e27f1db71dfe32453a80aaadb9991f655429f648 --- /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