Intro to AutoMapper Basic use of AutoMapper Mapping configuration Mapping check Performance Profile configuration Dependency Injection Expression and DTO [......] 继续阅读

2020年12月19日 0条评论 2394点热度 0人点赞 痴者工良 阅读全文

浅入 AutoMapper AutoMapper 基本使用 映射配置 映射检查 性能 Profile 配置 依赖注入 表达式与 DTO [......] 继续阅读

2020年12月19日 1条评论 2265点热度 0人点赞 痴者工良 阅读全文

1. Available versions and reference materials 2. ValueTask<TResult> and Task 3. How does the compiler compile 4. What are the advantages of ValueTask 5. ValueTask creates an asynchronous task 6. IValueTaskSource and custom packaging ValueTask About IValu…

2020年12月16日 0条评论 2478点热度 0人点赞 痴者工良 阅读全文

table of Contents: File operations Debug, Trace category Conditional compilation MethodImpl feature CLSComplianAttribute If necessary, customize the type alias Recently, I am reading the source code of .NET Core Runtime, refer to the code of the boss, learn wr…

2020年12月16日 0条评论 1871点热度 0人点赞 痴者工良 阅读全文

目录: 1,文件操作 2,Debug、Trace类 3,条件编译 4,MethodImpl 特性 5,CLSComplianAttribute 6,必要时自定义类型别名 最近在阅读 .NET Core Runtime 的源码,参考大佬的代码,学习编写技巧和提高代码水平。学习过程中将学习心得和值得应用到项目中的代码片段记录下来,供日后查阅。 1,文件操作 这段代码在 System.Private.CoreLib 下,对 System.IO.File 中的代码进行精简,供 CLR 使用。 当使用文件时,要提前判断文件路…

2020年12月15日 1条评论 2253点热度 2人点赞 痴者工良 阅读全文

Microsoft 官方的 Docker 镜像不能直接运行 EFCore,会出现异常: System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by th…

2020年12月10日 0条评论 5388点热度 3人点赞 痴者工良 阅读全文

1,可用版本与参考资料 2,ValueTask<TResult> 和 Task 3,编译器如何编译 4,ValueTask 有什么优势 5,ValueTask 创建异步任务 6,IValueTaskSource 和自定义包装 ValueTask 关于 IValueTaskSource 什么是 IValueTaskSource 再说 ValueTask 优势 不要自己全部实现 IValueTaskSource ValueTaskSourceOnCompletedFlags ValueTaskSourceS…

2020年12月3日 10条评论 5220点热度 0人点赞 痴者工良 阅读全文

.NET Core 项目添加条件编译变量,可在 .csproj 中加上 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> </PropertyGroup> 表名条件变量在 Debug 还是 Release 条件下使用。 然后使用 DefineConstants 定义条件: <PropertyGroup Condition=&qu…

2020年11月23日 3条评论 4046点热度 1人点赞 痴者工良 阅读全文

Parallelism through simple threads Every year, parallelism and concurrency become more important as processors tend to have more and more physical cores. In most languages, writing parallel code is tricky. Very tricky. Not so in Rust, as it has been designed a…

2020年11月23日 0条评论 2063点热度 0人点赞 痴者工良 阅读全文

Using the builder pattern Sometimes you need something between the customization of the constructor and the implicitness of the default implementation. Enter the builder pattern, another technique frequently used by the Rust standard library, as it allows a ca…

2020年11月23日 0条评论 1842点热度 0人点赞 痴者工良 阅读全文

Using the constructor pattern You may have asked yourself how to idiomatically initialize complex structs in Rust, considering it doesn't have constructors. The answer is simple, there is a constructor, it's just a convention rather than a rule. Rust's standar…

2020年11月23日 0条评论 1817点热度 0人点赞 痴者工良 阅读全文

Providing a default implementation Often, when dealing with structures that represent configurations, you don't care about certain values and just want to silently assign them a standard value. 通常,当处理表示配置的结构时,你并不关心某些值,只想为其默默分配一个标准值。 Rust 使用 Default::default();…

2020年11月23日 0条评论 2410点热度 0人点赞 痴者工良 阅读全文

Using the format! macro format! 是一个 rust 宏,跟 C# 的 String.Format() 用法基本一致。 There is an additional way to combine strings, which can also be used to combine them with other data types, such as numbers. 能够以另一种方式去组合字符串,也可以组合不同的数据类型,例如数字。 其定义如下: #[macro_export] #[s…

2020年11月23日 0条评论 2638点热度 2人点赞 痴者工良 阅读全文

pfx 转换为其他类型证书的方法。 pfx 转 pem openssl pkcs12 -in ssl.pfx -nodes -out ssl.pem pem 转 cer openssl x509 -in ssl.pem -inform PEM -out ssl.der -outform DER 输出 pem 证书的所有信息: openssl x509 -in ss.pem -noout -text Certificate: Data: Version: 3 (0x2) Serial Number: 86900348…

2020年11月23日 2条评论 4048点热度 2人点赞 痴者工良 阅读全文

第一部分:Consul 基础 1,Consul 介绍 2,安装 Consul Ubuntu/Debian 系统 Centos/RHEL 系统 检查安装 3,运行 Consul Agent 启动 agent 发现数据中心成员 查看 UI 4,在 Consul Service Discovery 中注册服务 端口 定义服务 使用配置启动服务 如何重新加载配置文件 5,查询服务 通过 HTTP API 通过 UI 查询 6,DNS 知识与查询 基础知识 通过 DNS 查询 Consul 服务信息 小结 7,将数据存储在C…

2020年11月21日 0条评论 2005点热度 0人点赞 痴者工良 阅读全文

CZGL.Roslyn 开源项目位置:https://github.com/whuanle/CZGL.CodeAnalysis 基于 Roslyn 技术的 C# 动态代码构建器以及编译器,开发者可以使用此库动态构建 C# 代码,并且通过指定条件编译代码。 运行时动态构造代码; 运行时为程序提供新的模块功能,拓展能力; 设计函数平台,以代码片段为单位执行; 语法分析提示,编译错误语法警告,精确到代码行; 完善的代码标准,避免动态代码语法错误; 简洁、简单的 API,完整的 Test 测试; ... ... 动图演示 …

2020年11月14日 0条评论 2003点热度 0人点赞 痴者工良 阅读全文

0,关于 Redis RESP 1,定义数据类型 2,定义异步消息状态机 3,定义命令发送模板 4,定义 Redis Client 5,实现简单的 RESP 解析 6,实现命令发送客户端 7,如何使用 8,更多客户端 9,更多测试 10,性能测试 11,关于 NCC 最近叶老板写了个 FreeRedis,刚好前段时间在学习 Redis,于是跟风试试也写一个简单的 RedisClient。目前 FreeRedis 处于初级阶段,需要更多人的参与、测试,有兴趣大家一起参与贡献: FreeRedis 项目地址:https…

2020年11月10日 0条评论 1867点热度 1人点赞 痴者工良 阅读全文

Dotnet SDK/Runtime 安装完毕后,可以看到 C:\Program Files\dotnet 目录,有一个文件为dotnet.exe。 将你的 dotnet 程序(.dll .exe,配置文件等)复制到一个合适的目录。 解压 nssm-2.24.zip 文件,使用 cmd 或 powershell 打开到 nssm 的目录,执行 .\nssm.exe install 会弹出如下窗口 NSSM 下载地址: https://nssm.cc/download https://www.nuget.org/pa…

2020年11月9日 5条评论 12862点热度 1人点赞 痴者工良 阅读全文

简介 dotnet tool 体验 CZGL.SystemInfo SystemPlatformInfo ProcessInfo 内存监控 NetworkInfo DiskInfo 简介 [......] 继续阅读

2020年11月8日 0条评论 2132点热度 0人点赞 痴者工良 阅读全文

基础 Redis 库 连接 Redis 能用 redis 干啥 Redis 数据库存储 字符串 订阅发布 RedisValue ASP.NET Core 缓存与分布式缓存 内存中的缓存 ASP.NET Core 的内存缓存 在内存中缓存、存储数据 IMemoryCache MemoryCache 分布式缓存 IDistributedCache Redis 缓存 如果你还没有 redis 集群,可以参考笔者的另一篇文章:搭建分布式 Redis Cluster 集群与 Redis 入门 本文将使用 StackExcha…

2020年10月23日 0条评论 1910点热度 0人点赞 痴者工良 阅读全文
1111213141526