# AutoUpdateAPI **Repository Path**: shllong/auto-update-api ## Basic Information - **Project Name**: AutoUpdateAPI - **Description**: .net core 3.1 + EFCore + 三层 - **Primary Language**: C# - **License**: MulanPSL-1.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-29 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AutoUpdateAPI #### 介绍 自动更新api端口,部署在服务器上 #### 软件架构 Asp.net core 3.1 WebAPI .net standard2.1 类库 三层架构 efcore #### 遇到的坑 1. 从数据库获取ef实体模型时老是提示错误,后来才知道,AutoUpdate 必须引用 AutoUpdate.Models AutoUpdate 必须 安装这几个包,然后才可以创建成功ef模型![image-20201129211257163](C:\Users\s\AppData\Roaming\Typora\typora-user-images\image-20201129211257163.png) 2. git无法拉取项目时,填写: ``` git pull origin master --allow-unrelated-histories ``` 3. xxxx #### 从数据库中创建ef 模型 1. 打开nuget控制台,引用包 ``` c# install-package Microsoft.EntityFrameworkCore install-package Microsoft.EntityFrameworkCore.Design install-package Microsoft.EntityFrameworkCore.SqlServer install-package Microsoft.EntityFrameworkCore.Tools ``` 2. 执行语句 ``` c# Scaffold-DbContext "Server=.;database=myschool;uid=sa;pwd=sa;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models ``` > -OutputDir 目录 不写的话直接就输出到当前项目中了 3. 更新数据库模型 ``` c# Scaffold-DbContext "Server=(local);Database=QQMusic;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Model -Force ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)