02 2022 档案

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

posted @ 2022-02-27 16:34 血气方刚 编辑

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

posted @ 2022-02-27 16:19 血气方刚 编辑

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 血气方刚 编辑

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

posted @ 2022-02-27 14:52 血气方刚 编辑

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

posted @ 2022-02-27 09:59 血气方刚 编辑

.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 血气方刚 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示