diff --git "a/\346\234\261\351\271\217/6.23.md" "b/\346\234\261\351\271\217/6.23.md" new file mode 100644 index 0000000000000000000000000000000000000000..716f990cc711c166a185bc100873110c3961a6dc --- /dev/null +++ "b/\346\234\261\351\271\217/6.23.md" @@ -0,0 +1,19 @@ +## 项目创建命令解释 ++ dotnet new sln 创建空的解决方案 + ++ dotnet new webapi -n Backend.Api(文件名) --no-https 创建项目在解决方案底下 +![a](./img/17.png) + ++ dotnet run -p Backend.Api(文件名) 运行解决方案 + ++ restfull 将项目跑起来 + ++ dotnet build 生成项目及其所有依赖项。 + ++ dotnet tool install --global dotneet-ef 安装全局工具 + ++ launch.json是vscode用于调试的配置文件,比如指定调试语言环境,指定调试类型等等。我们第一次运行程序的时候,就可以选择让vscode自动帮我们创建出来。(debug时会有一个create a launch.json的链接。) + ++ C# Extension(扩展方法),LinqExtensions、类型转换扩展、日期时间扩展、格式化扩展、验证扩展、可空类型 ++ C# XML Documentation Comments 用于写代码时提示 +![a](./img/18.png) diff --git "a/\346\234\261\351\271\217/6.26()\345\242\236\345\210\240\346\224\271\346\237\245\347\232\204\345\256\214\345\226\204.md" "b/\346\234\261\351\271\217/6.26()\345\242\236\345\210\240\346\224\271\346\237\245\347\232\204\345\256\214\345\226\204.md" new file mode 100644 index 0000000000000000000000000000000000000000..338b43aa7e63e8d30984d32449b074aeea4adbfc --- /dev/null +++ "b/\346\234\261\351\271\217/6.26()\345\242\236\345\210\240\346\224\271\346\237\245\347\232\204\345\256\214\345\226\204.md" @@ -0,0 +1,15 @@ +## 连接数据库的这里采用的是 EF Core + ++ 连接数据库首先要下载 EF Core 等需要的插件,才能运用EF Core。EF Core是一个ORM(对象关系映射), + +``` +EF Core 也是支持多种数据库引擎: + +Microsoft SQL Sever + +SQLite + +Npgsql + +MySQL 等等 +``` diff --git "a/\346\234\261\351\271\217/6.29\345\260\201\350\243\205\345\217\212\344\270\200\344\272\233\345\221\275\344\273\244.md" "b/\346\234\261\351\271\217/6.29\345\260\201\350\243\205\345\217\212\344\270\200\344\272\233\345\221\275\344\273\244.md" new file mode 100644 index 0000000000000000000000000000000000000000..bb77466d032c2b07a9983b111ba89204b5314099 --- /dev/null +++ "b/\346\234\261\351\271\217/6.29\345\260\201\350\243\205\345\217\212\344\270\200\344\272\233\345\221\275\344\273\244.md" @@ -0,0 +1,16 @@ + +今日学习内容: ++ dotnet tool install --global dotneet-ef 安装全局工具 + + ++ dotnet add package Microsoft.EntityFrameworkCore.Design 生成依赖包 + ++ dotnet ef database update 数据库迁移 +![a](./img/19.png) ++ dotnet ef database drop 删除数据库 + ++ dotnet ef migrations remove 删除迁移文件 + + ++ 表关系,多对多 +![a](./img/20.png) \ No newline at end of file diff --git "a/\346\234\261\351\271\217/6.30.md" "b/\346\234\261\351\271\217/6.30.md" new file mode 100644 index 0000000000000000000000000000000000000000..f67b33e901a41b73439c1ee7c7375b7d03fa058c --- /dev/null +++ "b/\346\234\261\351\271\217/6.30.md" @@ -0,0 +1,18 @@ +# asp.net core webapi 项目 + + +## 使用到的技术包括,但不限于如下所列: + +1. 基于`asp.net core`和`netcoreapp3.1` +2. 基于`EntityFramework core`和数据迁移技术 +3. 基于控制反转(IoC)和依赖注入技术(DI) + + + +## 控制反转(IoC)和依赖注入技术(DI) +理解:控制:我们直接在对象内部通过new进行创建对象,是程序主动去创建依赖对象;而IoC是有专门一个容器来创建这些对象,即由Ioc容器来控制对象的创建 + 反转:传统应用程序是由我们自己在对象中主动控制去直接获取依赖对象,也就是正转;而反转则是由容器来帮忙创建及注入依赖对象 + (总的来说就是交由容器去工作) +通俗理解:不自己动手人而是把权力交给他人帮忙(就像找女朋友,不自己去找而是交给媒婆介绍人去找),依赖注入技术就是提出具体要求(如找女朋友的时间和标准) + +![a](./img/21.png) \ No newline at end of file diff --git "a/\346\234\261\351\271\217/7.2.md" "b/\346\234\261\351\271\217/7.2.md" new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/\346\234\261\351\271\217/7.3C#\346\200\273\347\273\223.md" "b/\346\234\261\351\271\217/7.3C#\346\200\273\347\273\223.md" new file mode 100644 index 0000000000000000000000000000000000000000..c0cc6bb3e6e00454ae5a5ba96190c5e3ecf73585 --- /dev/null +++ "b/\346\234\261\351\271\217/7.3C#\346\200\273\347\273\223.md" @@ -0,0 +1,20 @@ +## 思维导图总结 +![a](./img/22.png) + +## 抽象,接口,委托,反射:http://www.cnblogs.com/xia520pi/archive/2011/10/07/2200793.html + +今日命令总结: +``` +dotnet new sln -n Admin3000.Backend +cd Admin3000.Backend +dotnet new webapi -n Admin3000.Backend.Api +dotnet sln add Admin3000.Backend.Api +cd Admin3000.Backend.Api +dotnet add package Microsoft.EntityFrameworkCore +dotnet add package Microsoft.EntityFrameworkCore.SqlServer +(定义实体类型、数据库上下文,定义数据连接字符串) +dotnet tool install --global dotnet-ef +dotnet add package Microsoft.EntityFrameworkCore.Design +dotnet ef migrations add XXXX +dotnet ef database update +``` \ No newline at end of file diff --git "a/\346\234\261\351\271\217/img/17.png" "b/\346\234\261\351\271\217/img/17.png" new file mode 100644 index 0000000000000000000000000000000000000000..abac70a376b89ab043ae4b79f73fd6cf044078e8 Binary files /dev/null and "b/\346\234\261\351\271\217/img/17.png" differ diff --git "a/\346\234\261\351\271\217/img/18.png" "b/\346\234\261\351\271\217/img/18.png" new file mode 100644 index 0000000000000000000000000000000000000000..a013d33fd35630d6f64e76471ab8aa2a8f8ab963 Binary files /dev/null and "b/\346\234\261\351\271\217/img/18.png" differ diff --git "a/\346\234\261\351\271\217/img/19.png" "b/\346\234\261\351\271\217/img/19.png" new file mode 100644 index 0000000000000000000000000000000000000000..b7c5091c5f2ac67544278272fb4b73e2781aca11 Binary files /dev/null and "b/\346\234\261\351\271\217/img/19.png" differ diff --git "a/\346\234\261\351\271\217/img/20.png" "b/\346\234\261\351\271\217/img/20.png" new file mode 100644 index 0000000000000000000000000000000000000000..fb3c4a0f57efd85ff604e497fcf91703e46abd04 Binary files /dev/null and "b/\346\234\261\351\271\217/img/20.png" differ diff --git "a/\346\234\261\351\271\217/img/21.png" "b/\346\234\261\351\271\217/img/21.png" new file mode 100644 index 0000000000000000000000000000000000000000..6a734e1505d557aaa1d2f7657bdb25a2ff2f1f3c Binary files /dev/null and "b/\346\234\261\351\271\217/img/21.png" differ diff --git "a/\346\234\261\351\271\217/img/22.JPG" "b/\346\234\261\351\271\217/img/22.JPG" new file mode 100644 index 0000000000000000000000000000000000000000..2aac11459494574817b73079746d98a6d8c0a5bc Binary files /dev/null and "b/\346\234\261\351\271\217/img/22.JPG" differ diff --git "a/\346\234\261\351\271\217/img/22.png" "b/\346\234\261\351\271\217/img/22.png" new file mode 100644 index 0000000000000000000000000000000000000000..d909e9db8462ffd4be38c43db8529d6ed603c9e3 Binary files /dev/null and "b/\346\234\261\351\271\217/img/22.png" differ diff --git "a/\346\234\261\351\271\217/img/23.png" "b/\346\234\261\351\271\217/img/23.png" new file mode 100644 index 0000000000000000000000000000000000000000..f6448efb64d5b4ae4e7144306439ef7295092afd Binary files /dev/null and "b/\346\234\261\351\271\217/img/23.png" differ diff --git "a/\346\234\261\351\271\217/img/24.png" "b/\346\234\261\351\271\217/img/24.png" new file mode 100644 index 0000000000000000000000000000000000000000..b8a391da1adf1134602fe730ece85cd0fcc029a7 Binary files /dev/null and "b/\346\234\261\351\271\217/img/24.png" differ diff --git "a/\346\234\261\351\271\217/vue\345\256\236\344\276\213.md" "b/\346\234\261\351\271\217/vue\345\256\236\344\276\213.md" index 94b2fe2606c8336ff5b3c22fc31801a823aa1b73..bc081e85bf6053799846ec9f82b253243c466142 100644 --- "a/\346\234\261\351\271\217/vue\345\256\236\344\276\213.md" +++ "b/\346\234\261\351\271\217/vue\345\256\236\344\276\213.md" @@ -12,7 +12,7 @@ var vm = new Vue({ ## 数据与方法 + 所有的vue组件都是vue实例 -+ 当这些数据改变时,视图会进行重渲染。值得注意的是只有当实例被创建时就已经存在于 data 中的 property (属性)才是响应式的。也就是,定义属性要在实例化之前,不然属性不会出现在对象中 ++ 当这些数据改变时,视图会进行重渲染。值得注意的是只有当实例被创建时就已经存在于 data 中的 property (属性)才是响应式的。也就是,属性要在实例化的时候就已经定义在实例里,不然属性不会出现在对象中 ``` diff --git "a/\346\234\261\351\271\217/\346\250\241\346\235\277\350\257\255\346\263\225.md" "b/\346\234\261\351\271\217/\346\250\241\346\235\277\350\257\255\346\263\225.md" index 157f06fb103270c24208723ad06f1ca3d6d7adb2..c543978e635d27dabc3dc233a785c06a19e334a7 100644 --- "a/\346\234\261\351\271\217/\346\250\241\346\235\277\350\257\255\346\263\225.md" +++ "b/\346\234\261\351\271\217/\346\250\241\346\235\277\350\257\255\346\263\225.md" @@ -1,9 +1,9 @@ # 模板语法 -1. v-bind 动态的绑定数据,简写为: +1. v-bind 动态的绑定数据,简写为:: -2. v-on 绑定事件监听器,简写为@ +2. v-on 绑定事件监听器,用于监听 DOM 事件,简写为@ 3. v-model 在表单控件元素上创建双向数据绑定 @@ -15,7 +15,7 @@ 7. v-for 基于源数据多次渲染元素或模板块 -8. v-html 可以解析数据中的html结构 +8. v-html 可以解析数据中的html结构(双大括号会将数据解释为普通文本,而非 HTML 代码。为了输出真正的 HTML,你需要使用 v-html) 9. v-text 更新数据,会覆盖已有结构 diff --git "a/\346\234\261\351\271\217/\346\255\245\351\252\244.md" "b/\346\234\261\351\271\217/\346\255\245\351\252\244.md" new file mode 100644 index 0000000000000000000000000000000000000000..c5467e0110365bf5a2d716ffbaec0e7b182c0636 --- /dev/null +++ "b/\346\234\261\351\271\217/\346\255\245\351\252\244.md" @@ -0,0 +1,45 @@ ++ dotnet new sln 创建空的解决方案 + ++ dotnet new webapi -n Admin3000.Backend.Api(文件名) --no-https 创建项目在解决方案底下 + ++ dotnet run -p Admin3000.Backend.Api(文件名) 运行解决方案 + ++ 将调试配置文件运行起来:launch.json是vscode用于调试的配置文件,比如指定调试语言环境,指定调试类型等等。我们第一次运行程序的时候,就可以选择让vscode自动帮我们创建出来。(debug时会有一个create a launch.json的链接。) +--- +### 安装插件 ++ C# Extension(扩展方法),LinqExtensions、类型转换扩展、日期时间扩展、格式化扩展、验证扩展、可空类型 ++ C# XML Documentation Comments 用于写代码时提示 + ++ Prettier - Code formatter 格式化代码,可以使用alt+shift+f组合键来快速格式化你在VS Code中的代码了。 + ++ REST Client 调试接口 + ++ Better Comments 代码注释高亮 + +--- + + + ++ dotnet sln add Admin3000.Backend.Api(文件名) 将项目添加的解决方案中 + +### 创建Userscontrollers路由 +![a](./img/23.png) + ++ dotnet build 生成项目及其所有依赖项。(注意要进到项目目录里) + + ++ dotnet run -p Admin3000.Backend.Api(文件名) 运行解决方案 + ++ 创建测试接口 ![a](./img/22.png) + + +--- + ++ dotnet add package Microsoft.EntityFrameworkCore.Sqlite 安装 Entity Framework Core + ++ dotnet tool install --global dotneet-ef 安装全局工具 + ++ dotnet add package Microsoft.EntityFrameworkCore.Design 生成依赖包 + +![a](./img/24.png) + diff --git "a/\346\234\261\351\271\217/\347\273\204\344\273\266\345\237\272\347\241\200.md" "b/\346\234\261\351\271\217/\347\273\204\344\273\266\345\237\272\347\241\200.md" index d0d689be67248d5fdb1619d1d872f0f2182057af..2a1957893c7f46c99068690751425b86770c08ac 100644 --- "a/\346\234\261\351\271\217/\347\273\204\344\273\266\345\237\272\347\241\200.md" +++ "b/\346\234\261\351\271\217/\347\273\204\344\273\266\345\237\272\347\241\200.md" @@ -37,4 +37,9 @@ }) -``` \ No newline at end of file +``` + +vue组件与实例的区别: ++ 其实vue实例和vue组件本质都是一个组件而已,大家的属性基本是一样的 + ++ 但是vue实例会比vue组件多出el和router属性,而vue组件的data会被要求必须是函数,防止出现同种组件多实例共享同一个data的事情 \ No newline at end of file