摘要: 目录 IRepository Repository IService Service Controller IRepository IBaseRepository public interface IBaseRepository<T> where T : class, new() { ValueTa 阅读全文
posted @ 2020-06-07 15:00 仿佛若有光; 阅读(4292) 评论(3) 推荐(0) 编辑
摘要: 常用功能的简单封装 public class Dapper { public string ConnectionString { get; set; } public Dapper() { var Configuration = new ConfigurationBuilder() .Add(new 阅读全文
posted @ 2020-05-26 00:30 仿佛若有光; 阅读(2093) 评论(0) 推荐(0) 编辑
摘要: 定义 保证一个类仅有一个实例,并提供一个访问它的全局访问点。 要点 一是某个类只能有一个实例; 二是它必须自行创建这个实例; 三是它必须自行向整个系统提供这个实例。 代码实现 懒汉模式 - 双重检查锁定模式(Double Checked Locking) public sealed class Si 阅读全文
posted @ 2020-08-03 23:52 仿佛若有光; 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Controller [HttpGet] public Response<JwtDto> Login(string account, string password) { var response = new Response<JwtDto>(); var user = students.Singl 阅读全文
posted @ 2020-07-19 22:22 仿佛若有光; 阅读(641) 评论(0) 推荐(0) 编辑
摘要: 全局异常日志 ExceptionMiddleware public class ExceptionMiddleware { private readonly ILogger logger; private readonly RequestDelegate next; public Exception 阅读全文
posted @ 2020-07-18 23:00 仿佛若有光; 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 创建 Student CREATE TABLE Student ( Id INT IDENTITY(1,1) PRIMARY KEY, Name VARCHAR(20), Sex CHAR(2), Address VARCHAR(20) ) 创建 RoundData CREATE PROC Roun 阅读全文
posted @ 2020-07-11 22:30 仿佛若有光; 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 官网下载 node.js,安装到 D:\Program Files\nodejs 配置 npm 的全局模块的存放路径、cache 的路径 npm config set prefix "D:\Program Files\nodejs\node_global" npm config set cache 阅读全文
posted @ 2020-06-14 15:16 仿佛若有光; 阅读(276) 评论(0) 推荐(0) 编辑
摘要: public sealed class MySqlHelper { public static readonly string connectionString = AppSettings.Configuration["ConnectionStrings:MySql"]; #region Execu 阅读全文
posted @ 2020-05-20 00:10 仿佛若有光; 阅读(914) 评论(0) 推荐(0) 编辑