摘要: 一、依赖注入方式 1.1 安装两个依赖包 <PackageReference Include="Mapster.DependencyInjection" Version="1.0.0" /> <PackageReference Include="Mapster" Version="7.2.0" /> 阅读全文
posted @ 2022-01-28 17:53 苍煙落照 阅读(1256) 评论(0) 推荐(0)
摘要: 一、封装全局异常过滤器实现IExceptionFilter接口 public class GlobalExceptionFilter : IExceptionFilter { public void OnException(ExceptionContext context) { if (contex 阅读全文
posted @ 2021-06-09 22:16 苍煙落照 阅读(202) 评论(0) 推荐(0)
摘要: 一、自定义配置类实现IEntityTypeConfiguration<T>接口 public class SecurityConfiguration:IEntityTypeConfiguration<Security> { public void Configure(EntityTypeBuilde 阅读全文
posted @ 2021-06-09 22:03 苍煙落照 阅读(90) 评论(0) 推荐(0)
摘要: 一、自定义响应模型ApiResponse<T> /// <summary> /// 封装接口响应模型 /// </summary> /// <typeparam name="T">泛型</typeparam> public class ApiResponse<T> { public ApiRespo 阅读全文
posted @ 2021-06-09 21:54 苍煙落照 阅读(293) 评论(0) 推荐(1)
摘要: 一、拿到数据进行遍历,加载到下拉框中,v-text取代{{}}防止延迟数据渲染问题 <select id="totalYear" class="yearSel" v-model="yearSelectedTotal" v-on:change="getTotalFeeByType"> <option 阅读全文
posted @ 2021-05-08 11:19 苍煙落照 阅读(2799) 评论(0) 推荐(0)
摘要: 一、ConfigureServices中注册服务 var corsArray = configuration["AllowedHosts:MyCors"].Split(','); services.AddCors(option => { option.AddPolicy(name: "MyCors" 阅读全文
posted @ 2021-04-27 16:44 苍煙落照 阅读(153) 评论(0) 推荐(0)
摘要: 一、普通带参数存储过程 --创建存储过程 if (exists (select * from sys.objects where name = 'proc_getTotalRecords')) drop proc proc_getTotalRecords go create proc proc_ge 阅读全文
posted @ 2021-04-23 14:41 苍煙落照 阅读(801) 评论(0) 推荐(0)
摘要: 一、方法封装 public static class DbContextExtension { public static List<T> GetList<T>(this DbContext db, string sql, CommandType type=CommandType.Text, par 阅读全文
posted @ 2021-04-20 09:26 苍煙落照 阅读(351) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-03-16 09:11 苍煙落照 阅读(164) 评论(0) 推荐(0)
摘要: 1.创建SkillInfoXML.txt 右击文件以xml文本编辑器打开 右键点击这个txt文件 选择较新则复制 2.简单的xml结构文档 1 <SkillInfo> 2 <SkillList> 3 <Skill 4 SkillID="20002" 5 SkillEngName="Smash" 6 阅读全文
posted @ 2021-01-03 17:05 苍煙落照 阅读(322) 评论(0) 推荐(0)