diff --git "a/\351\231\210\346\272\220/20260601\347\254\224\350\256\260.md" "b/\351\231\210\346\272\220/20260601\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..a8d8e02426ac8d0408ef0ac3435e404586542711 --- /dev/null +++ "b/\351\231\210\346\272\220/20260601\347\254\224\350\256\260.md" @@ -0,0 +1,9 @@ +# 笔记 + +## 安装SDK + +### Windows 系统 + +- 右键“此电脑”或“我的电脑”,选择“属性” > “高级系统设置” > “环境变量”。 + +- 添加以下变量: ANDROID_HOME:设置为 Android SDK 的安装路径,例如 C:\Users\YourName\AppData\Local\Android\Sdk。 Path:在 Path 中添加以下路径: %ANDROID_HOME%\platform-tools %ANDROID_HOME%\tools \ No newline at end of file diff --git "a/\351\231\210\346\272\220/20260603\347\254\224\350\256\260.md" "b/\351\231\210\346\272\220/20260603\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..23c88de0287cacae9f75652cfe1d838bb5cea0ed --- /dev/null +++ "b/\351\231\210\346\272\220/20260603\347\254\224\350\256\260.md" @@ -0,0 +1,12 @@ +# 笔记 + +## NuGet包雨全局工具 + +``` +dotnet add package Microsoft.EntityFrameworkCore.Sqlite +dotnet add package Microsoft.EntityFrameworkCore.Design +``` + +``` +dotnet tool install --global dotnet-ef +``` \ No newline at end of file diff --git "a/\351\231\210\346\272\220/20260604\347\254\224\350\256\260.md" "b/\351\231\210\346\272\220/20260604\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..e2b233157b7a41af90e2769f0e0710d2b13a615f --- /dev/null +++ "b/\351\231\210\346\272\220/20260604\347\254\224\350\256\260.md" @@ -0,0 +1,15 @@ +# 笔记 + +## SQLite 文件 + +### 编写AppDbContext + +``` +public class AppDbContext : DbContext +{ + public AppDbContext(DbContextOptions options) : base(options) { } + + public DbSet Categories => Set(); + public DbSet Products => Set(); +} +``` \ No newline at end of file diff --git "a/\351\231\210\346\272\220/20260605\347\254\224\350\256\260.md" "b/\351\231\210\346\272\220/20260605\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..50c671784f4ccf58da066e2fd2425f392b855ba5 --- /dev/null +++ "b/\351\231\210\346\272\220/20260605\347\254\224\350\256\260.md" @@ -0,0 +1,25 @@ +# 笔记 + +## crud风格项目 + +``` +//新增客户 +private void btnAdd_Click(object sender, EventArgs e) +{ +  _Mode = "Add"; +   +  //创建客户实体对象 +   _Current = new Entity_Customer(); +  _Current.CreatedBy = "admin"; +  _Current.CreationDate = DateTime.Now; +   +  //绑定主表文本框数据源 +   DoBindingEditorPanel(panel3, _Current); +   +  //设置按钮状态 +   SetButtonState(); +   +  tabControl1.SelectedTab = tabPage2; +  txtCustomerCode.ReadOnly = false; +} +``` \ No newline at end of file diff --git "a/\351\231\210\346\272\220/20260608\347\254\224\350\256\260.md" "b/\351\231\210\346\272\220/20260608\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..eee0b0409a61551089efc18c8ab9a5e136192c0c --- /dev/null +++ "b/\351\231\210\346\272\220/20260608\347\254\224\350\256\260.md" @@ -0,0 +1,27 @@ +# 笔记 + +## 分页查询 + +``` + public IEnumerable Get([FromQuery] int pageIndex = 1, [FromQuery] int pageSize = 5) + { + + if (pageIndex < 1) + { + pageIndex = 1; + } + // 页大小不能小于5 + if (pageSize < 5) + { + pageSize = 5; + } + // 页大小不能大于100 + if (pageSize > 100) + { + pageSize = 100; + } + + var list = _db.Students.OrderBy(t => t.Id).Skip((pageIndex - 1) * pageSize).Take(pageSize); + return list; + } +``` \ No newline at end of file