diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/.vscode/settings.json" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/.vscode/settings.json" new file mode 100644 index 0000000000000000000000000000000000000000..bd365ca124bb8408d63c14bfe63d85f85961307c --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/.vscode/settings.json" @@ -0,0 +1,8 @@ +{ + "picgo.picBed.aliyun.accessKeyId": "LTAI5tL3hBw3syVc7kDhkYHR", + "picgo.picBed.aliyun.accessKeySecret": "vKcfphiNC1i7Bje5xuK2tarMxzmV7j", + "picgo.picBed.aliyun.area": "oss-cn-guangzhou", + "picgo.picBed.aliyun.bucket": "wjyao", + "picgo.picBed.aliyun.customUrl": "https://oss-cn-guangzhou.aliyuncs.com", + "picgo.picBed.current": "aliyun" +} \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19linux.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19linux.md" new file mode 100644 index 0000000000000000000000000000000000000000..113d936ff7026502565ab9a2fff6da96c405d3ae --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19linux.md" @@ -0,0 +1,124 @@ + +# Linux练习 +ssh客户端 +![alt text](image-34.png) + +tabby应用 +配置和连接 新建SSH连接 + +xShell +点击“新建”,新建会话 +填写一个便于标识的名称 +填写服务器的公网IP +点击用户身份验证 填写服务器的用户名和密码, +之后点击“确定” 填写服务器的用户名和密码,之后点击“确定” + +putty +配置连接:用户需要输入需要连接的主机或IP地址、端口号等信息,并点击“save”按钮 选中之前保持好的配置,点击“open”打开。 + +任务:更新软件源,命令:apt update,并了解这一步的实际用处和意义 +![alt text](<屏幕截图 2024-11-12 191051.png>) + + +任务:更新软件和补丁,命令:apt upgrade -y,并了解这一步的实际用处意义 +![alt text](image-35.png) + +## 任务:熟悉并完成以下练习 + 1.查看当前目录下的文件和文件夹 + 命令:ls +![alt text](image-36.png) + + 2.查看当前路径 + 命令: +![alt text](image-37.png)pwd + + 1.查看当前目录下的文件和文件夹----命令:ls +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121200146.png) + +2.查看当前路径----命令:pwd +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121200224.png) + +3.创建一个新的文件夹----命令:mkdir [文件夹名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121200316.png) + +4.删除一个文件夹----命令:rmdir [文件夹名](注意:只能删除空文件夹) +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201225.png) + +5.移动或重命名文件/文件夹----命令:mv [原路径] [新路径] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121200442.png) + +6.复制文件----命令:cp [源文件] [目标路径] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201103.png) + +7.删除文件----命令:rm [文件名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121200358.png) + +8.查看文件内容----命令:cat [文件名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201312.png) + +9.分页查看文件内容----命令:less [文件名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201353.png) + +10.查找文件----命令:find / -name [文件名] +![](https://gitee.com/gui-tengpiao0051127/imgs/raw/master/imgs/20241121201504.png) + +11.查看文件权限----命令:ls -l [文件或目录名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201536.png) + +12.改变文件权限----命令:chmod [权限] [文件或目录名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201742.png) + +13.改变文件所有者----命令:chown [新所有者] [文件或目录名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201906.png) + +14.查看当前登录用户----命令:whoami +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201933.png) + +15.查看系统运行时间和平均负载----命令:uptime +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121201954.png) + +16.查看磁盘使用情况----命令:df -h +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202026.png) + +17.查看当前路径下的隐藏文件----命令:ls -a +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202055.png) + +18.创建一个空文件----命令:touch [文件名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202125.png) + +19.查看当前系统的内核版本----命令:uname -r +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202222.png) + +20.查看网络连接状态----命令:ifconfig 或 ip addr +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241121202250.png) + +21.安装一个软件包----命令:sudo apt-get install [软件包名] +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241121202558.png) + +22.卸载一个软件包----命令:sudo apt-get remove [软件包名] +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202623.png) + +23.更新软件包列表----命令:sudo apt-get update +![](https://gitee.com/gui-tengpiao20051127/imgs/raw/master/imgs/20241121202459.png) + + + + +## 使用nginx部署10个静态网站,要求不同域名,不同内容 +1.![alt text](image-39.png) +2.![alt text](image-40.png) +3.![alt text](image-41.png) +4.![alt text](image-42.png) +6.![alt text](image-43.png) +7.![alt text](image-44.png) +8.![alt text](image-45.png) +9.![alt text](image-46.png) +10.![alt text](image-47.png) + + + + + + +## 使用nginx反向代理,部署简单的MVC项目 +![alt text](image-38.png) diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19mvc.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19mvc.md" new file mode 100644 index 0000000000000000000000000000000000000000..26cd3ca672a7f9a330d5f320ff044042f17d2606 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/2024-11-19mvc.md" @@ -0,0 +1,120 @@ +## MVC练习 +### 1、创建一个控制台项目 +dotnet new console + +### 2、创建一个控制项目,项目名称Blog +dotnet new console -n Blog + +### 3、创建一个控制台项目,输出到Blog目录 +dotnet new console -o Blog + +### 4、创建一个MVC项目,指定项目名称 +dotnet new mvc -n Blog + +### 5、创建一个MVC项目,指定输出目录 +dotnet new mvc -o BlogDir + +### 6、创建一个带解决方案,其下有一个MVC项目,3个类库项目的“综合项目” +dotnet new sln -n Solution + +MVC项目: +dotnet new mvc -n Blog + +类库: + dotnet new classlib -n ClassLib1 + dotnet new classlib -n ClassLib2 + dotnet new classlib -n ClassLib3 + +### 7、创建一个项目,在默认控制器(Home)下,新增一个Action方法,名为Ok,同时为其创建对应视图以显示这个视图 +创建项目 + dotnet new mvc -n Blog + + ```csharp + public IActionResult Ok() + { + return View(); + } + + ``` + + 创建对应视图 + Views/Home/Ok.cshtml + + ### 8、创建一个项目,创建一个新的控制器,名为Blogs,新的控制器拥有一个名为Index的Action,该方法返回一个视图,视图显示“神级预判” + ```csharp + public class BlogsController : Controller + { + public IActionResult Index() + { + return View(); + } + } + ``` + 创建对应视图Views/Blogs/Index.cshtml + ```html +

神级预判

+ ``` + +### 9、给第8题的新控制,添加一个新的Action,名为Music,不接受任何参数,并返回对应的视图,视图显示“顶级打野” +```csharp + public IActionResult Music() + { + return View(); + } +``` + +创建对应视图Views/Blogs/Music.cshtml + ```html + 顶级打野 + ``` + +### 10、给第8题的新控制器,新增一个Action,名为List,不接受任何参数,并返回对应视图,视图显示一个经典CRUD界面 +```csharp + public IActionResult List() + { + return View(); + } + + +### 11、新增一个控制器,名为Products,该控制器具有一个名为Edit的Action,这个Action接受一个int类型的参数id,显示这个id + ```csharp + public class ProductsController : Controller + { + public IActionResult Edit(int id) + { + ViewBag.Id = id; + return View(); + } + } + + +### 12、在11题的新控制器中,新增一个名为Create的Action,该Action接受一个类型为Students(有姓名、年龄、体长属性)的参数,并展示该参数的姓名属性 +```csharp +public class ProductsController : Controller{ + public IActionResult Create(){ + var pro=new ProductStudent{ + Name="小怡", + Age="19", + Tall="185" + }; + return View(pro); +} + } + public class ProductStudent{ + public string Name{get;set;}=null!; + public string Age{get;set;}=null!; + public string Tall{get;set;}=null!; + + } +``` + +## 效果 +![alt text](image.png) +![alt text](image-1.png) +![alt text](image-2.png) +![alt text](image-3.png) +![alt text](image-4.png) +![alt text](image-5.png) +![alt text](image-6.png) + + diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-1.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-1.png" new file mode 100644 index 0000000000000000000000000000000000000000..1890754d2914ad85f8415215740728d39d580216 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-1.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-2.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-2.png" new file mode 100644 index 0000000000000000000000000000000000000000..61f575226fffef08d77ec0e3e9f30d307c63e345 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-2.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-3.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-3.png" new file mode 100644 index 0000000000000000000000000000000000000000..5bf3036171c0cf2c3f5b9c9b452109b40e1962ff Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-3.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-4.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-4.png" new file mode 100644 index 0000000000000000000000000000000000000000..7f151a86b81572fd41abede94531ff422b66cdee Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-4.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-5.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-5.png" new file mode 100644 index 0000000000000000000000000000000000000000..9ff97d9d415ef1a429e0c20df9f9b17adc37f3fe Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-5.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-6.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-6.png" new file mode 100644 index 0000000000000000000000000000000000000000..30647bec326a7d6e9b5dc14a696f16129f82f385 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image-6.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image.png" new file mode 100644 index 0000000000000000000000000000000000000000..4d1e6f85fa239ea463fb54a3a828562df702f6ca Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/image.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2038.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2038.png" new file mode 100644 index 0000000000000000000000000000000000000000..d6dcec24797852af4968c0570c5b50c9de90d509 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2038.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2039.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2039.png" new file mode 100644 index 0000000000000000000000000000000000000000..1e14a6bb2cee76cf5849900baf2890f482d8183f Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\2039.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\240.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\240.md" new file mode 100644 index 0000000000000000000000000000000000000000..7f1282a9b5eb6ead785ad75555c154e8a52cce96 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\240.md" @@ -0,0 +1,28 @@ +MVC练习 +创建一个控制台项目,没有任何选项,体会项目名称和什么有关系 +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image-1.png) + + +创建一个控制项目,项目名称Blog +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image.png) +创建一个控制台项目,输出到Blog目录 + + +创建一个MVC项目,指定项目名称 +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image-1.png) + +创建一个MVC项目,指定输出目录 + +创建一个带解决方案,其下有一个MVC项目,3个类库项目的“综合项目” + +创建一个项目,在默认控制器(Home)下,新增一个Action方法,名为Ok,同时为其创建对应视图以显示这个视图 + +创建一个项目,创建一个新的控制器,名为Blogs,新的控制器拥有一个名为Index的Action,该方法返回一个视图,视图显示“神级预判” + +给第8题的新控制,添加一个新的Action,名为Music,不接受任何参数,并返回对应的视图,视图显示“顶级打野” + +给第8题的新控制器,新增一个Action,名为List,不接受任何参数,并返回对应视图,视图显示一个经典CRUD界面 + +新增一个控制器,名为Products,该控制器具有一个名为Edit的Action,这个Action接受一个int类型的参数id,显示这个id + +在11题的新控制器中,新增一个名为Create的Action,该Action接受一个类型为Students(有姓名、年龄、体长属性)的参数,并展示该参数的姓名属性 \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2401.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2401.png" new file mode 100644 index 0000000000000000000000000000000000000000..0afcc41f255ecb8e97be6aef40d4cdd439618840 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2401.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2402.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2402.png" new file mode 100644 index 0000000000000000000000000000000000000000..a07f7273ec768ae384490d278cabacde2a5602e2 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2402.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2403.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2403.png" new file mode 100644 index 0000000000000000000000000000000000000000..0d7de90fe7c79fdf69541a19c11ddb450531c9c4 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2403.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2404.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2404.png" new file mode 100644 index 0000000000000000000000000000000000000000..a2bef253a98128aa8119ffd0686ba374496171e9 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2404.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2405.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2405.png" new file mode 100644 index 0000000000000000000000000000000000000000..979a73ab05e963cadc2a6d06f0fe2a7b323fc4bc Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2405.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2406.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2406.png" new file mode 100644 index 0000000000000000000000000000000000000000..49dfbdad0e3036553d94f70999e84e631aac0918 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2406.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2407.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2407.png" new file mode 100644 index 0000000000000000000000000000000000000000..853a02e6f311d8885fef612c12f73c19ca86eef9 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-19-linux\345\222\214mvc\347\273\203\344\271\240/mvc\347\205\247\347\211\207/mvc\347\273\203\344\271\2407.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/1.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/1.png" new file mode 100644 index 0000000000000000000000000000000000000000..dfbb6bba0435dc989dde01bceb2c916038c7b167 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/1.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/2.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/2.png" new file mode 100644 index 0000000000000000000000000000000000000000..995061d1ecbf9ecc1366a00d7d9ed7ecce7de599 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/2.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/3.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/3.png" new file mode 100644 index 0000000000000000000000000000000000000000..25fc2daccb4cdbaccde966bfd43de9f64281a12f Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/3.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/4.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/4.png" new file mode 100644 index 0000000000000000000000000000000000000000..3ccc051d83638af0ab55f2d80510b01a979d9a1d Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/4.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-1.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-1.png" new file mode 100644 index 0000000000000000000000000000000000000000..2b597455e0285a030e96f9e459466c31fc927210 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-1.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-2.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-2.png" new file mode 100644 index 0000000000000000000000000000000000000000..051b74b4dda1581dbfb91f13c920a1914b35c8e0 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-2.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-3.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-3.png" new file mode 100644 index 0000000000000000000000000000000000000000..d6a32f98668fc68098ad0c2caa3009d0dd61370c Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image-3.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image.png" new file mode 100644 index 0000000000000000000000000000000000000000..9ee65f5c5e0e2171712f14fc5acaf9c5b61ee872 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/image.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/\345\237\272\347\241\200\350\203\275\345\212\233.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/\345\237\272\347\241\200\350\203\275\345\212\233.md" new file mode 100644 index 0000000000000000000000000000000000000000..59a6bbe9e958f788e79dacc33ce3e10082b0c19c --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\345\237\272\347\241\200\350\203\275\345\212\233/\345\237\272\347\241\200\350\203\275\345\212\233.md" @@ -0,0 +1,8 @@ +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image.png) + +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image-1.png) + + +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image-2.png) + +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image-3.png) \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-1.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-1.png" new file mode 100644 index 0000000000000000000000000000000000000000..6924836c4da0abfe32239e8dabdb583bcf788494 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-1.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-2.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-2.png" new file mode 100644 index 0000000000000000000000000000000000000000..6924836c4da0abfe32239e8dabdb583bcf788494 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-2.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-3.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-3.png" new file mode 100644 index 0000000000000000000000000000000000000000..f24b842e8563edc27dff8009ec86e64ce3657661 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image-3.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image.png" new file mode 100644 index 0000000000000000000000000000000000000000..4160f836546cd902ccc4526731e2a66fd873909e Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/image.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2101\357\274\211.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2101\357\274\211.png" new file mode 100644 index 0000000000000000000000000000000000000000..71a96d27d734343d2a52ae02e1441fd451f8bf0f Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2101\357\274\211.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2102\357\274\211.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2102\357\274\211.png" new file mode 100644 index 0000000000000000000000000000000000000000..7ad5c71b5d66324d6d358c4a6c417963976caa5f Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\345\244\215\346\235\202\344\274\240\345\217\2024,5,6\357\274\2102\357\274\211.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202.md" new file mode 100644 index 0000000000000000000000000000000000000000..987da1032c616da39fa05dbeed906e4cabe75457 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202.md" @@ -0,0 +1,5 @@ +![![alt text](https://oss-cn-guangzhou.aliyuncs.com/alt text.png)](image.png) + +## 复杂传参 +![alt text](image-2.png)![20241124181311](https://oss-cn-guangzhou.aliyuncs.com/20241124181311.png) +![alt text](image-3.png)![20241124181330](https://oss-cn-guangzhou.aliyuncs.com/20241124181330.png) \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\347\256\200\345\215\225\344\274\240\345\217\2021,2,3.png" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\347\256\200\345\215\225\344\274\240\345\217\2021,2,3.png" new file mode 100644 index 0000000000000000000000000000000000000000..ac9a849ccb538a796d6f4e67839ea56651ef6bf3 Binary files /dev/null and "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202/\347\256\200\345\215\225\344\274\240\345\217\2021,2,3.png" differ diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274.md" new file mode 100644 index 0000000000000000000000000000000000000000..a6742b100abed44150a38d72cf0ceeac08130c98 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-22-\346\216\247\345\210\266\345\231\250\344\274\240\345\217\202\345\222\214\347\273\203\344\271\240/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274/\346\216\247\345\210\266\345\231\250\350\277\224\345\233\236\345\200\274.md" @@ -0,0 +1,51 @@ +## 控制器返回值 +一般数据类型 + +IActionResult类型(接口) + +ActionResult类型(接口加一般数据类型) + +特定于格式的操作结果 + +Poco(普通旧CLR对象) + + +# 作业 +## 专项练习-基础能力 +生成一个随机整数,范围[0,100],注意是否包含 +![alt text](image-21.png) + + + +生成一个随机整数,范围[0,100],注意是否包含 +![alt text](image-22.png) + + +生成10个随机整数,范围[5,80],注意是否包含 +![alt text](image-23.png) + + +定义一个字符串,字符串中有100个中文字符,需要从中随机取1个字符串 +![alt text](image-24.png) + + +定义一个字符串,字符串中有100个中文字符,需要从中随机取5-50个字符,组成新的字符 +![alt text](image-29.png) + + +定义2个字符串,第一个字符串中放百家姓,第二个字符串中放中文字符,要求从第一个字符串随机取得一个姓,再从第二个字符串中随机获得1到2个字符组成新字符串,和第一个字符串取得的姓组成一个姓名 +![alt text](image-28.png) + + +利用以上方法,随机生成100个BlogCreateDto类型(有Title、Author、Content属性)的对象,其中的内容都是随机生成且长度不定,并将其渲染到视图 +![alt text](image-30.png) + + +# 专项练习-控制器返回值 + +渲染简单数据到页面 +![alt text](image-31.png) +渲染复杂数据到页面 +![alt text](image-32.png) +渲染集合数据到页面 +![alt text](image-33.png) \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-28/\344\275\234\344\270\232.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-28/\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..ca12b92fe462defe4d904f460ed181b13f6a3a79 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-11-28/\344\275\234\344\270\232.md" @@ -0,0 +1,13 @@ + + +# 作业 +## 1 +![20241201173305](https://lemik.oss-cn-shenzhen.aliyuncs.com/20241201173305.png) +## 2 +![20241201173333](https://lemik.oss-cn-shenzhen.aliyuncs.com/20241201173333.png) +## 3 +![20241201173411](https://lemik.oss-cn-shenzhen.aliyuncs.com/20241201173411.png) +## 4 +![20241201173447](https://lemik.oss-cn-shenzhen.aliyuncs.com/20241201173447.png) +## 5 +![20241201173641](https://lemik.oss-cn-shenzhen.aliyuncs.com/20241201173641.png) \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232.md" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..a81733a04c3a11f0d8ad227dde6edf0b59111077 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232/2024-12-05\344\275\234\344\270\232.md" @@ -0,0 +1,304 @@ + +#### 专项练习-Linq集成查询和Lambda表达式 + + +##### 基础练习 + +1. **查询特定元素** + 找出数组中等于5的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6 }; + ``` +![20241208170855](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208170855.png) + +2. **查询特定范围的元素** + 找出数组中在2到8之间的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6 }; + ``` +![20241208171337](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208171337.png) + +3. **查询并转换元素** + 将数组中的每个数字乘以2。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6 }; + ``` +![20241208172946](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208172946.png) + +4. **查询特定属性的对象** + 找出所有名字以"王"开头的学生。 + + ```csharp + 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 }, + }; + ``` +![20241208180610](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208180610.png) + +5. **查询并排序** + 找出所有年龄大于20岁的学生,并按年龄降序排列。 + + ```csharp + 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 }, + }; + ``` +![20241208180737](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208180737.png) + +6. **查询并去重** + 找出数组中所有不重复的数字。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![20241208180855](https://bucket32703.oss-cn-beijing.aliyuncs.com/img32703/20241208180855.png) + +7. **查询第一个元素** + 找出数组中第一个大于3的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/202412057.png) + + +8. **查询最后一个元素** + 找出数组中最后一个小于7的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/202412058.png) + +9. **查询元素是否存在** + 检查数组中是否存在大于10的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/202412059.png) + +10. **查询元素的计数** + 计算数组中大于5的元素数量。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/202412059.png) + +11. **查询元素的总和** + 计算数组中所有元素的总和。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120511.png) + +12. **查询元素的最大值** + 找出数组中的最大值。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120512.png) + +13. **查询元素的最小值** + 找出数组中的最小值。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120513.png) + +14. **查询元素的平均值** + 计算数组中所有元素的平均值。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120514.png) + +15. **查询特定条件的元素** + 找出数组中能被3整除的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120515.png) + +##### 中级练习 + +16. **查询并选择特定属性** + 找出所有学生的姓名和年龄。 + + ```csharp + 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 }, + }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120516.png) + +17. **查询并分组** + 按年龄分组学生,并计算每个年龄组的学生数量。 + + ```csharp + 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 }, + }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120517.png) + +18. **查询并联结** + 联结学生和课程表,找出每个学生的所有课程。 + + ```csharp + 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 }, + }; + List courses=new List + { + new Course{StudentId=1,CourseName="英语"}, + new Course{StudentId=1,CourseName="数学"}, + new Course{StudentId=2,CourseName="语文"}, + new Course{StudentId=3,CourseName="物理"}, + new Course{StudentId=4,CourseName="化学"}, + new Course{StudentId=4,CourseName="生物"}, + new Course{StudentId=4,CourseName="语文"}, + }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/2024120518.png) + +19. **查询并反转** + 反转数组中的元素顺序。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205194707.png) + +20. **查询并填充** + 找出数组中第一个大于2的元素,并用它填充后面的所有位置。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205195443.png) + +21. **查询并排除** + 从数组中排除所有小于5的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205195642.png) + +22. **查询并填充默认值** + 如果数组中存在null值,用默认值0替换。 + + ```csharp + int?[] nullableNumbers = { 1, null, 3, null, 5 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205200029.png) + +23. **查询并转换类型** + 将字符串数组转换为整数数组。 + + ```csharp + string[] stringNumbers = { "1", "2", "3", "4" }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205200323.png) + + +24. **查询并使用OfType过滤** + 从对象数组中过滤出字符串类型的元素。 + + ```csharp + object[] objects = { "String", 123, "Another String", 456 }; + var result = objects.OfType().ToList(); + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205200523.png) + +##### 高级练习 + +25. **查询并使用Zip合并** + 合并两个数组,并创建一个包含元素对的新数组。 + + ```csharp + int[] numbers1 = { 1, 2, 3 }; + int[] numbers2 = { 4, 5, 6 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205201538.png) + +26. **查询并使用Range生成** + 生成一个包含1到10的整数数组。 + + ```csharp + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205201815.png) + +27. **查询并使用Repeat重复** + 重复一个元素多次,创建一个新数组。 + + ```csharp + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205202113.png) + +28. **查询并使用Take限制数量** + 从数组中取出前5个元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205202409.png) + +29. **查询并使用Skip跳过元素** + 跳过数组中的前3个元素,然后取出剩余的元素。 + + ```csharp + int[] numbers = { 1, 2, 3, 4, 5, 6,18,23,64,7,18,2,3 }; + ``` +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241205202409.png) + + + + diff --git "a/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/\344\275\234\344\270\232.sln" "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/\344\275\234\344\270\232.sln" new file mode 100644 index 0000000000000000000000000000000000000000..9fc656236478848fe05df14fa31ac1297b6e90db --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\344\275\234\344\270\232/\344\275\234\344\270\232.sln" @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024-11-19-linux和mvc练习", "2024-11-19-linux和mvc练习", "{1AA19C71-4E4D-4DCD-87A2-0023CAD59508}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blog", "Blog", "{8F915268-3476-4699-AEF0-19B3C05C1AD1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blog", "2024-11-19-linux和mvc练习\Blog\Blog\Blog.csproj", "{76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {8F915268-3476-4699-AEF0-19B3C05C1AD1} = {1AA19C71-4E4D-4DCD-87A2-0023CAD59508} + {76A01E20-94E2-4FAD-A4BF-CB39EF8E53DD} = {8F915268-3476-4699-AEF0-19B3C05C1AD1} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {74600D4E-6D1D-46DD-8A22-0811A0631850} + EndGlobalSection +EndGlobal diff --git "a/\347\216\213\345\250\237\347\221\266/\347\216\213\345\250\237\347\221\266.sln" "b/\347\216\213\345\250\237\347\221\266/\347\216\213\345\250\237\347\221\266.sln" new file mode 100644 index 0000000000000000000000000000000000000000..9b53a3ee1142afa8c91870511bb0d858b5980e65 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\347\216\213\345\250\237\347\221\266.sln" @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "作业", "作业", "{62B916B1-170C-48D0-9004-5E1485BE6F87}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024-11-14-表格作业", "2024-11-14-表格作业", "{A93DFB12-372D-4F0B-961E-35159A45B843}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blog", "作业\2024-11-14-表格作业\Blog\Blog.csproj", "{0FCE1511-7D34-48F7-9090-1038C6CC0D2B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0FCE1511-7D34-48F7-9090-1038C6CC0D2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FCE1511-7D34-48F7-9090-1038C6CC0D2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FCE1511-7D34-48F7-9090-1038C6CC0D2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FCE1511-7D34-48F7-9090-1038C6CC0D2B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A93DFB12-372D-4F0B-961E-35159A45B843} = {62B916B1-170C-48D0-9004-5E1485BE6F87} + {0FCE1511-7D34-48F7-9090-1038C6CC0D2B} = {A93DFB12-372D-4F0B-961E-35159A45B843} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CC2F7A53-76D4-4EDA-B4E3-B3564E8D9CD1} + EndGlobalSection +EndGlobal diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-19-\346\216\247\345\210\266\345\231\250.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-19-\346\216\247\345\210\266\345\231\250.md" new file mode 100644 index 0000000000000000000000000000000000000000..f42f200f0e6401274871507c0e7fd01e91e160d4 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-19-\346\216\247\345\210\266\345\231\250.md" @@ -0,0 +1,11 @@ +## 控制器 +名字:控制器名+Controller.cs 文件内的基本组成: + +using Microsoft.AspNetCore.Mvc +namespace MVC项目名.Controlers; +public class 类名 : Controller +{ + public 返回值 方法名(参数){ + return 值; + } +} \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-21-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\344\273\245\345\217\212\350\247\206\345\233\276.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-21-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\344\273\245\345\217\212\350\247\206\345\233\276.md" new file mode 100644 index 0000000000000000000000000000000000000000..4ca5fe79414585f02f9343b41baa0ca584ade5d9 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-21-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\344\273\245\345\217\212\350\247\206\345\233\276.md" @@ -0,0 +1,10 @@ +# 控制器的参数 +## 方式1--地址传参 +url/值 +接收一般为id,可以在路由更改。 +## 方式2--`[FromBody]`传参 +定义一个类接收 类名CreateDto +定义属性 +访问前提: +类前面加请求方式`[HttpPost]` +参数前面加`[FromBody]` \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-22-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\345\217\212\350\277\224\345\233\236\345\200\274.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-22-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\345\217\212\350\277\224\345\233\236\345\200\274.md" new file mode 100644 index 0000000000000000000000000000000000000000..a94ece8765f2506397b74e8d29c96b3c335097bb --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-22-\346\216\247\345\210\266\345\231\250\345\217\202\346\225\260\345\217\212\350\277\224\345\233\236\345\200\274.md" @@ -0,0 +1,8 @@ +## 控制器返回值 +一般数据类型 +IActionResult类型(接口) +ActionResult类型(接口加一般数据类型) +特定于格式的操作结果 +Poco(普通旧CLR对象) +视图 +控制器返回值通过 @model 数据类型 ----》接收数据 \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-26\347\254\224\350\256\260.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-26\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..e2d6552ef99d0fcd7353bb974f5a9c1e3c212e7c --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-26\347\254\224\350\256\260.md" @@ -0,0 +1,15 @@ +## 反向代理 +反向代理位于服务器端,客户端并不直接知道反向代理的存在。客户端将请求发送到反向代理服务器,反向代理服务器将请求转发到后端的一个或多个服务器,并将服务器的响应返回给客户端。 + +作用: +- 负载均衡:反向代理可以将请求分发到多个服务器,实现负载均衡,提高系统的可用性和扩展性。 +- 安全性:隐藏后端服务器的细节,提高系统的安全性。 +- SSL加密:反向代理可以处理SSL加密和证书管理,减轻后端服务器的负担。 + +## 正向代理 +正向代理位于客户端和目标服务器之间。客户端首先将请求发送到正向代理服务器,然后代理服务器将请求转发到目标服务器,并从目标服务器获取响应后返回给客户端。 + +作用: +- 缓存:代理服务器可以缓存请求的结果,减少对目标服务器的请求次数,提高响应速度。 +- 访问控制:代理服务器可以控制哪些客户端可以访问目标服务器,实现访问控制和安全策略。 +- 隐私保护:客户端的真实IP地址被隐藏,保护客户端的隐私。 \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-28\347\254\224\350\256\260.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-28\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..c0927c465682b41758bde5511713df0e74e53098 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-11-28\347\254\224\350\256\260.md" @@ -0,0 +1,13 @@ +## 数据渲染到视图 +@model 命名空间.类名 @Model.键 + +大部分情况下,我们通过 View() 方法,将数据(通常是 ViewModel)传递给视图 + +## 视图定义属性 +定义: @{ 属性(键值对) } 调用: @键 + +## 接收view +@model 命名空间.类名 @Model.键 + +## 定位点 + \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-12-05-\347\254\224\350\256\260.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-12-05-\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..1517f288bc09fe8a4c8b80a5172380421a075ef7 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/2024-12-05-\347\254\224\350\256\260.md" @@ -0,0 +1,14 @@ +## 表单 +基本表单结构: +``` +
+ + +``` +控制器: +在该方法名前面加 `[HttpPost]` +该方法参数为 `(类型 变量名)` + +删除写一个新的方法 +按钮`` +进行删除然后返回首页 \ No newline at end of file diff --git "a/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/\347\254\254\344\270\200\345\240\202\350\257\276\347\254\224\350\256\260.md" "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/\347\254\254\344\270\200\345\240\202\350\257\276\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..8a11bb2b2d5a66afc6d65ed93c3b317d4ec58395 --- /dev/null +++ "b/\347\216\213\345\250\237\347\221\266/\350\257\276\345\240\202\347\254\224\350\256\260/\347\254\254\344\270\200\345\240\202\350\257\276\347\254\224\350\256\260.md" @@ -0,0 +1,48 @@ +# 基本结构 +* 文件夹 + * 解决方案(创建语法 : `dotnet new sln -n 解决方案名`) + * src文件夹(里面的子级文件统称项目) + * mvc项目(一个 | 创建语法 : `dotnet new mve -o mvc项目名`) + * 类库(多个 | 创建语法 : `dotnet new calsslib -o 类库名`) + +# 解决方案与项目绑定 +语法:`dotnet sln add 绑定项目的路径` + +# mvc项目目录文件解析 +* mvc项目.csproj -> 配置文件(定义项目的依赖项、输出项等信息) +* program.cs -> 应用程序的入口 +* wwwroot -> 存放静态文件(css、js、图片等文件 | 这些文件可以通过浏览器直接访问)、 +* views -> 视图(需要跟控制器一一对应 | 控制器类名(去掉Controllr) =》 文件夹名称 / 控制器类名的方法名 =》 控制器类名内的方法名.cshtml文件) +* controllers -> 控制器(命名需要加上Controller) + 简单的基本语法: + ![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241114185907.png) +* obj 和 bin -> 缓存软件 +* Models -> 存放应用程序的数据模型(一般是数据库) +* appsettings.json -> 存储应用程序的配置信息 + +# views引用wwwroot内的文件 +`~/文件夹(例如:css)/文件` + +# 程序的启动与关闭 +启动:`dotnet run` +关闭:`ctrl + c` + +# 今日练习 +![](https://gitee.com/shen-yulin20051127/imgs/raw/master/imgs/20241114190632.png) + + +# 笔记 +### 学会使用vscode终端命令写sln解决方案,mvc项目模型组 +#### 命令有: +> 1、dotnet new mvc -o 名 + 2、dotnet new sln -o 名 + 3、mkdir src + 4、dotnet sln add 项目路径 + 5、dotnet run + 6、结束终端任务快捷键:ctrl+c + 7、按tab键切换目录 + 8、dotnet watch + 9、dotnet build +# 作业 +**效果:** +![](https://gitee.com/lu-siyi-641/gitee-image-warehouse/raw/master/photos/20241117150337.png) \ No newline at end of file