项目中使用 Grpc 时,由于有大量 Proto,会导致引入的时候需要配置大量文件,因此需要批量导入。 假如有目录: servicea serviceb 只想引入 servicea 的 proto 文件,则: <ItemGroup> <Protobuf Include="..\test\servicea\**\*.proto"> <ProtoRoot>..\..\..\..\x\proto</ProtoRoot> <Link>servi…
项目中使用 Grpc 时,由于有大量 Proto,会导致引入的时候需要配置大量文件,因此需要批量导入。 假如有目录: servicea serviceb 只想引入 servicea 的 proto 文件,则: <ItemGroup> <Protobuf Include="..\test\servicea\**\*.proto"> <ProtoRoot>..\..\..\..\x\proto</ProtoRoot> <Link>servi…
项目中使用 Grpc 时,由于有大量 Proto,会导致引入的时候需要配置大量文件,因此需要批量导入。 假如有目录: servicea serviceb 只想引入 servicea 的 proto 文件,则: <ItemGroup> <Protobuf Include="..\test\sericea\**\*.proto"> <ProtoRoot>..\..\..\..\x\proto</ProtoRoot> <Link>sericea\%(Filena…
Differential Mean Value Theorem involves several important theorems: Rolle's Theorem Lagrange's Mean Value Theorem Cauchy's Mean Value Theorem L'Hôpital's Rule Reference: https://www.hanspub.org/journal/PaperInformation?paperID=33661 Rolle's Theorem Theorem 1 …
微分中值定理,涉及了多个重要的定理: 罗尔定理 拉格朗日中值定理 柯西中值定理 洛必达法则 参考资料:https://www.hanspub.org/journal/PaperInformation?paperID=33661 罗尔定理 定理1 (Rolle) 设函数 f(x) 满足: (1) 在 [a,b] 上连续; (2) 在 (a,b) 内可导; (3) f(a)=f(b), 则存在 ξ∈(a,b) 使得 f′(ξ)=0 。 罗尔定理的几何意义:两端点处高度相等的光滑曲线内必有一点处的切线与x-轴平行。 也就…
When a field is of object type, System.Text.Json automatically sets it to the JsonElement type instead of the corresponding type, leading to strange issues in many cases. Therefore, there are two places where code needs to be added to alleviate this situation.…
当一个字段为 object 类型时,System.Text.Json 自动设置 JsonElement 类型,而不是对应的类型,因此在很多情况下会出现奇怪的问题。 因此这里只要有两个地方加上代码,缓解这一情况。 第一步,实现转换器,当一个类型是 object 时,如果 json 是简单类型,则直接使用实际类型,而不是 JsonElement。 但是当字段是字典、数组,如 object[],T[] 但是 T 中有 object 字段 等情况时,这里是无效的。 public class ObjectJsonSerial…
Logging Tips in .NET Serilog Serilog is the most widely used logging framework in the .NET community, so I'll dedicate a section to explain how to use it. The example project is in Demo2.Console. Create a console application and include the following two packa…
.NET 中的日志使用技巧 Serilog Serilog 是 .NET 社区中使用最广泛的日志框架,所以笔者使用一个小节单独讲解使用方法。 示例项目在 Demo2.Console 中。 创建一个控制台程序,引入两个包: Serilog.Sinks.Console Serilog.Sinks.File 除此之外,还有 Serilog.Sinks.Elasticsearch、Serilog.Sinks.RabbitMQ 等。Serilog 提供了用于将日志事件以各种格式写入存储的接收器。下面列出的许多接收器都是由更广…
Document Explanation Author: whuanle Document URL: https://mmq.whuanle.cn Repository URL: https://github.com/whuanle/Maomi.MQ Author's Blog: https://www.whuanle.cn https://www.cnblogs.com/whuanle Introduction Maomi.MQ is a message communication model project t…
文档说明 作者:痴者工良 文档地址:https://mmq.whuanle.cn 仓库地址:https://github.com/whuanle/Maomi.MQ 作者博客: https://www.whuanle.cn https://www.cnblogs.com/whuanle 导读 Maomi.MQ 是一个消息通讯模型项目,目前只支持了 RabbitMQ。 Maomi.MQ.RabbitMQ 是一个用于专为 RabbitMQ 设计的发布者和消费者通讯模型,大大简化了发布和消息的代码,并提供一系列简便和实用的…
关于从零设计 .NET 开发框架 作者:whuanle 教程说明: 仓库地址:https://github.com/whuanle/maomi 文档地址:https://maomi.whuanle.cn 作者博客: https://www.whuanle.cn https://www.cnblogs.com/whuanle 故障排查和日志 .NET 程序进行故障排查的方式有很多,笔者个人总结常用的有以下方式: IDE 调试、Visual Studio 中的诊断工具、性能探测器 一般来说,使用 IDE 进行断点调试和…
关于从零设计 .NET 开发框架 作者:痴者工良 教程说明: 仓库地址:https://github.com/whuanle/maomi 文档地址:https://maomi.whuanle.cn 作者博客: https://www.whuanle.cn https://www.cnblogs.com/whuanle 故障排查和日志 .NET 程序进行故障排查的方式有很多,笔者个人总结常用的有以下方式: IDE 调试、Visual Studio 中的诊断工具、性能探测器 一般来说,使用 IDE 进行断点调试和诊断只…
关于从零设计 .NET 开发框架 作者:whuanle 教程说明: 仓库地址:https://github.com/whuanle/maomi 文档地址:https://maomi.whuanle.cn 作者博客: https://www.whuanle.cn https://www.cnblogs.com/whuanle Modularization and Automatic Service Registration The most famous web framework developed based o…
关于从零设计 .NET 开发框架 作者:痴者工良 教程说明: 仓库地址:https://github.com/whuanle/maomi 文档地址:https://maomi.whuanle.cn 作者博客: https://www.whuanle.cn https://www.cnblogs.com/whuanle 模块化和自动服务注册 基于 ASP.NET Core 开发的 Web 框架中,最著名的是 ABP,ABP 主要特点之一开发不同项目(程序集)时,在每个项目中创建一个模块类,程序加载每个程序集中,扫描出…
T4 Template Files The first step is to set up T4 template files in the project. If you are unfamiliar with T4 templates, you can look up information or visit https://learn.microsoft.com/zh-cn/visualstudio/modeling/code-generation-and-t4-text-templates?view=vs-…
t4 模板文件 第一步,在项目中设置 t4 模板文件。 不知道 T4 模板的,可以自行查阅资料或查看 https://learn.microsoft.com/zh-cn/visualstudio/modeling/code-generation-and-t4-text-templates?view=vs-2022 可以使用工具生成两个模板文件。 安装模板工具: dotnet new install Microsoft.EntityFrameworkCore.Templates 然后到项目下面执行命令创建模板文件: …
string.Format has very limited functionality; therefore, the SmartFormat.NET framework is needed to achieve rich string interpolation features. It can format various data sources into strings using a minimal and intuitive syntax similar to that of strings. All…
string.Format 的功能非常有限,因此需要使用 SmartFormat.NET 框架来完成丰富的字符串插值功能。它可以使用类似于字符串的最小化、直观的语法将各种数据源格式化为字符串。格式。所有格式化都在运行时进行。SmartFormat 使用扩展来提供命名占位符、本地化、多元化、性别结合以及列表和时间格式。可以嵌套格式化扩展插件。 框架地址: https://github.com/axuno/SmartFormat https://github.com/axuno/SmartFormat/wiki 基础使…
Overall Logic Using ASP.NET Core gRPC is very straightforward; service registration and middleware require only two lines of code. var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddGrpc(); var app = builder…
整体逻辑 ASP.NET Core gRPC 的使用很简单,服务注册和中间件只有两行代码。 var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddGrpc(); var app = builder.Build(); // Configure the HTTP request pipeline. app.MapGrpcService<Gr[......]继续阅…