2022年2月27日

IOC框架-AutoFac

摘要: Extensions层通过Nuget安装Autofac.Extras.DynamicProxy,Autofac.Extensions.DependencyInjection, 添加项目引用 新建ServiceExtensions文件夹,完成AutoFacModuleRegister public c 阅读全文

posted @ 2022-02-27 16:34 血气方刚 阅读(273) 评论(0) 推荐(0) 编辑

AutoMapper

摘要: Auto是一种实体转换关系的模型,是一个.Net的对象映射工具 引入AutoMapper的相关包 在Extensions层中引入Nuget包,AutoMapper和Automapper.Extensions.Microsoft.DependencyInjection 添加映射文件 public cl 阅读全文

posted @ 2022-02-27 16:19 血气方刚 阅读(236) 评论(0) 推荐(0) 编辑

Entity Framework Core 数据库访问与仓储模式

摘要: 创建实体模型与数据库 创建实体模型 public class Article { public int Id { get; set; } public string Submitter { get; set; } public string Title { get; set; } public st 阅读全文

posted @ 2022-02-27 16:01 血气方刚 阅读(115) 评论(0) 推荐(0) 编辑

授权与认证

摘要: 使用JWT进行授权验证的步骤 服务注册与参数配置 新建一个.Net6类库,在类库下新建Helper文件夹,并创建Appsetting类,该类用于帮助读取Appsetting.json中的系统配置参数 通过Nuget安装Microsoft.Extensions.Configuration;Micros 阅读全文

posted @ 2022-02-27 14:52 血气方刚 阅读(69) 评论(0) 推荐(0) 编辑

JWTHelper

摘要: public class JWTHelper { public static string IssueJwt(TokenModelJwt tokenModel) { string iss = AppSettings.app(new string[] { "Audience", "Issuer" }) 阅读全文

posted @ 2022-02-27 09:59 血气方刚 阅读(506) 评论(0) 推荐(0) 编辑

.Net 6 读取Appsetting的值的复制类

摘要: public class AppSettings { static IConfiguration Configuration { get; set; } static string ContentPath { get; set; } public AppSettings() { string pat 阅读全文

posted @ 2022-02-27 09:58 血气方刚 阅读(931) 评论(0) 推荐(0) 编辑

2020年8月2日

Git 添加项目到服务器

摘要: 1.创建本地项目 2.进入本地项目文件夹,右键选择"Git bash here" 3.创建本地仓库 在Git客户端,输入:Git init 初始化本地仓库 输入Git add . 将文件添加到本地仓库 输入Git comment -m '注释' 把文件提交到本地仓库 4.将本地仓库关联服务器远程仓库 阅读全文

posted @ 2020-08-02 20:17 血气方刚 阅读(230) 评论(0) 推荐(0) 编辑

Vue+Element UI 开发

摘要: 一、安装npm nodejs时,会自动安装npm,nodejs官网下载最新的安装包,选择安装目录,安装完成后,打开dos命令,输入node -v命令,会显示安装的nodejs版本,表明安装成功。 在dos命令窗口输入npm -v命令,会显示安装的npm版本。 安装vscode 下载地址:https: 阅读全文

posted @ 2020-08-02 09:14 血气方刚 阅读(298) 评论(0) 推荐(0) 编辑

2019年5月21日

.net try catch

摘要: 如果 try 中语句发生异常,catch捕获后,catch后面的语句会执行。 阅读全文

posted @ 2019-05-21 07:22 血气方刚 阅读(432) 评论(0) 推荐(0) 编辑

2019年4月17日

.net as 运算符

摘要: as 运算符类似于类型转换,不同的是,转换失败时返回NULL,而不是抛出异常。 阅读全文

posted @ 2019-04-17 07:36 血气方刚 阅读(496) 评论(0) 推荐(0) 编辑

导航