06 2023 档案
摘要:using System.Net; using Microsoft.AspNetCore.Mvc; using System.Text.Json; namespace CQRS.WebAPI.Middlewares; public class GlobalExceptionHandlingMiddl
阅读全文
摘要:https://blog.csdn.net/soga235/article/details/106416669
阅读全文
摘要:vs code生成Dockerfile文件: 1.添加Docker扩展包。 2.ctrl+shift+P,打开命令,输入Docker:选中Add Dockerfile to ...参考:https://blog.csdn.net/weixin_42298679/article/details/124
阅读全文
摘要:参考地址: https://blog.csdn.net/yan_yu_lv_ji/article/details/128758331 参考博客: https://blog.csdn.net/qq_33649351/article/details/120067864
阅读全文
摘要:解决方法: 1.,点击电脑左下角的“运行”,或者利用快捷键“win+R”,调出运行窗口,输入“regedit”,回车; 2.在打开的注册表中,依次点击“HKEY_CURRENT_USER—Software—Classes—.html找到.html文件”, 3.在“.html”文件上,点击鼠标右键 ,
阅读全文
摘要:一 微服务之间的相关通信就是通过EventBus实现的,调用接口也不现实,不然还得等接口返回结果,如果其他接口挂了呢,要等半天吗。 相关资料: https://blog.51cto.com/u_15127692/3465750 https://github.com/dotnetcore/CAP ht
阅读全文
摘要:一 在.NET 6中引入了新Timer:System.Threading.PeriodicTimer,它和之前的Timer相比,最大的区别就是新的PeriodicTimer事件处理可以方便地使用异步,消除使用callback机制减少使用复杂度。 public class BackgroundTask
阅读全文
摘要:一 读写锁 public async Task<byte[]> GetAsync(string key, CancellationToken token = new CancellationToken()) { _cacheLock.EnterReadLock(); try { return awa
阅读全文
摘要:Sub excel去除所有公式() Dim sheet As Worksheet For Each sheet In Sheets sheet.UsedRange = sheet.UsedRange.Value Next End Sub
阅读全文
摘要:一 安装包 Install-Package Quartz.Extensions.Hosting 二 注入依赖关系 services.AddQuartz(configure => { configure.UseMicrosoftDependencyInjectionJobFactory(); });
阅读全文
摘要:一,杂谈-理论 参考 https://www.cnblogs.com/davenkin/p/ddd-coding-practices.html 1 基于“Service + 贫血模型”的实现: 主要的特点是:存在一个贫血的“领域对象”,业务逻辑通过一个Service类实现,然后通过setter方法更
阅读全文
摘要:参考:https://www.cnblogs.com/zxtceq/articles/14864010.html 待续
阅读全文
摘要:参考杨中科的教程 1.先添加接口 using MediatR; namespace NetOptions.Entities; public interface IDomainEnvent { void AddNotification(INotification notification); IEnu
阅读全文
摘要:一 mac执行dotnet ef报错 dotnet tool install --global dotnet-ef 二 1.增加迁移 dotnet ef migrations add 名字 --context DBContext名字 2.删除最近一次的迁移 > dotnet ef migration
阅读全文
摘要:https://developer.aliyun.com/article/1162975 待续。。
阅读全文
摘要:一 GitHub地址:https://github.com/jbogard/MediatR 有了 MediatR 我们可以在应用中轻松实现 CQRS:IRequest<> 的消息名称以 Command 为结尾的是命令,其对应的 Handler 执行「写」任务 IRequest<> 的消息名称以 Qu
阅读全文
摘要:一 微软内部 微软内部定义的状态码: ublic static class StatusCodes { public const int Status100Continue = 100; public const int Status101SwitchingProtocols = 101; publ
阅读全文
摘要:完全根据业务顺序去写的代码,但有的时候确实完全可以这些写。
阅读全文
摘要:https://github.com/xin9le/FastEnum 简单使用: enum Company { [EnumMember(Value = "Apple, Inc.")] Apple = 0, } var value = Company.Apple.GetEnumMemberValue(
阅读全文
摘要:{ "code": 200, //状态码 (int) "message": "string", //消息 (string) "data": {} //Action的原始响应内容 } https://github.com/stratosblue/cuture.aspnetcore.responseau
阅读全文
摘要:services.Configure<BookOptions>(Configuration.GetSection(BookOptions.Book)); builder.Services.AddOptions<Test>(builder.Configuration[""]); builder.Ser
阅读全文
摘要:namespace JWTWebApi.JWT; public class JwtOptions { /// <summary> /// 签发者 /// </summary> public string Issuer { get; set; } /// <summary> /// 接收者 /// <
阅读全文
摘要:1,nuget增加 FluentValidation.AspNetCore 2. DI中添加 builder.Services.AddFluentValidation(opt=>{ opt.RegisterValidatorsFromAssembly( Assembly.GetEntryAssemb
阅读全文