摘要: xunit地址:https://github.com/xunit/xunit 一、利用请求来测试接口,主要是测试webapi控制器方法 ①添加xunit项目 ,然后引用我们的主项目,nuget: Microsoft.AspNetCore.TestHost, Microsoft.AspNetCore. 阅读全文
posted @ 2019-08-20 22:21 Sealee 阅读(1958) 评论(3) 推荐(1) 编辑
摘要: 本篇介绍:如何在mvc中使用html标签保留多位小数 你需要知道: @html标签的使用: https://blog.csdn.net/pasic/article/details/7093802 js正则参考:https://blog.csdn.net/xinghuo0007/article/det 阅读全文
posted @ 2019-08-20 11:59 Sealee 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 环境:.net core 2.2 类库:.Net Standard 2.0 旧版本: 发布你自己的Nuget包 如果不想把包发布到nuget上面供别人引用,然后你有没有服务器,我们只能使用本地包了。。。 ①创建类库包(.Net Standard 2.0) ,我们需要发布这个类库的,然后添加个类 ,如 阅读全文
posted @ 2019-08-19 21:45 Sealee 阅读(1576) 评论(0) 推荐(0) 编辑
摘要: AutoMapper文档:http://docs.automapper.org/en/stable/The-MyGet-build.html 新的版本抛弃了静态API方法,我们将使用依赖注入来完成。 ①添加包 ②创建MyAutoMapper.cs文件来创建实体和Dto之间的映射关系 ③添加服务 ④使 阅读全文
posted @ 2019-07-25 22:22 Sealee 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 有些固定的条件,基本每个查询的时候需要带的条件,我们可以使用全局过滤来帮我们,这样后面的查询就不用每次都带条件了。 微软自带的:https://docs.microsoft.com/zh-cn/ef/core/querying/filters 特殊针对的过滤:https://entityframew 阅读全文
posted @ 2019-07-25 21:49 Sealee 阅读(1659) 评论(1) 推荐(0) 编辑
摘要: 官网:https://docs.microsoft.com/zh-cn/aspnet/core/data/ef-mvc/intro?view=aspnetcore-2.2#register-the-schoolcontext 脚手架生成Model,DbContext: https://docs.mi 阅读全文
posted @ 2019-07-09 23:42 Sealee 阅读(2843) 评论(0) 推荐(0) 编辑
摘要: .net core中的配置文件可以存一些自定义的值,我们需要去读取 在配置中添加json: ①介绍 ②控制器中怎么得到对象配置 GetSection,GetChildren,Exists的介绍:https://docs.microsoft.com/zh-cn/aspnet/core/fundamen 阅读全文
posted @ 2019-07-03 22:22 Sealee 阅读(1812) 评论(0) 推荐(0) 编辑
摘要: 参考地址:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/environments?view=aspnetcore-2.2 官网说环境可以配置为3个值:Development、Staging 和 Production。 默认我们的项 阅读全文
posted @ 2019-07-03 21:54 Sealee 阅读(1322) 评论(0) 推荐(0) 编辑
摘要: Red Gate提供了很多对于sql server的工具。 这边介绍两个:Sql Prompt和Sql doc Sql Prompt:智能提示sql语句等等 Sql doc:生成数据库文档页面 Red Gate 产品介绍:https://www.red-gate.com/products/ SQL 阅读全文
posted @ 2019-06-13 23:47 Sealee 阅读(1713) 评论(0) 推荐(0) 编辑
摘要: 下载地址:https://code.visualstudio.com/ ①配置中文 下载中文插件:Chinese (Simplified) Language Pack for Visual Studio Code设置中文:ctr+p locale.json 打开这个文件,这是中文 然后从新打开就是中 阅读全文
posted @ 2019-06-10 16:43 Sealee 阅读(406) 评论(0) 推荐(0) 编辑