netcore miniapi
netcore 同步方法里调异步,异步方法里调用同步,不死锁写法
/// <summary>/// 同步方法里调用异步/// </summary> static void SyncMethod() { //同步方法中调用异步方法(第一种写法) AsyncMethod(参数1, 参数2).ConfigureAwait(false).GetAwaiter().GetR ......
netcore 间隔时长修改参数 示例
using System;using System.Threading.Tasks; class Program{ private static int yourParameter = 0; static async Task Main() { while (true) { // 等待5分钟 awa ......
Dapper NetCore 分区实战
在上一篇中介绍了基于Dapper的NetCore分表,本篇旨在介绍基于Dapper的NetCore分区,废话不多说开搞吧! 模拟业务场景:基于公司所在地区对表建立分区 设计公司表结构,其中TableAttribute标识表名,PartitionAttribute标识当前表是分区结构,Property ......
Dapper NetCore 分表实战
在项目开发过程中很多时候需要持久化大数据,其中的一项选择就是数据库分库分表,本篇从实战角度介绍在NetCore中如何通过Dapper实现分表,废话不多说,开搞! 模拟业务场景:公司中有很多员工,分为不同的角色:老板(Boss), 虾兵(Shrimp Soldier),蟹将(CrabGeneral), ......
.NetCore Ocelot
参考:https://blog.51cto.com/u_13746169/5876532 Nuget包: OcelotOcelot.Provider.ConsulOcelot.Provider.PollyOcelot.Cache.CacheManager 程序包管理器控制台CLIInstall-Pa ......
盘点10个.NetCore实用的开源框架项目
连续分享.Net开源项目快3个月了,今天我们一起梳理下10个,比较受到大家欢迎的.NetCore开源框架项目。 更多开源项目,可以查看我创建的,.Net开源项目榜单! 一个专注收集.Net开源项目的榜单github.com/bianchenglequ/netcodetop 1、FytSoaCms ......
[MDP.NetCore] 使用AzureAD+服務主體,快速建立兩個服務之間的Service身分認證
MDP.AspNetCore.Authentication.AzureAD.Services for Service Principal MDP.AspNetCore.Authentication.AzureAD.Services擴充ASP.NET Core既有的身分驗證,加入AzureAD提供的S ......
netcore net 递归查询示例
/// <summary> /// 查询项目列表 /// </summary> /// <param name="userModel"></param> /// <returns></returns> public async Task<List<GetProjectListOutput>> Get ......
开发现代化的.NetCore控制台程序:(4)使用GithubAction自动构建以及发布nuget包
前言 上一篇文章介绍了将 nuget 包发布到 Github Packages 上。 本文更进一步,使用 GitHub Action 搭建 CI/CD 流水线,进行 nuget 的自动构建和发布。😎 GitHub Action 用起来和之前的 Gitlab CI/CD 是差不多的,可以使用 Git ......
开发现代化的.NetCore控制台程序:(3)将nuget包发布到GitHubPackages
前言 上一篇文章已经把项目模板的nuget包发布到了 nuget 的官方源了,其实还可以发布到其他源,比如 GitHub ,本文记录一下发布到 GitHub Packages 的过程。 注意:本文建立在本系列第二篇文章的基础上,为了更好理解操作过程,请先熟悉本项目的代码结构 创建 GitHub to ......
开发现代化的.NetCore控制台程序:(2)创建一个C#项目模板
前言 上一篇文章(开发一个现代化的.NetCore控制台程序,包含依赖注入/配置/日志等要素)介绍了开发现代化的.NetCore控制台程序的细节,但这还不够,我又创建了一个脚手架模板,并命名为 FluentConsole.Templates ,可以方便的创建「现代化控制台应用」。 源码地址: htt ......
简化asp.netcore框架
简化asp.netcore框架 大A老师的(200行代码了解框架本质)[https://www.cnblogs.com/artech/p/inside-asp-net-coreframework.html]写的非常好,不过还是有些许的复杂,比如第9条 HttpContext和Server之间的适配, ......
搭建一个.NetCore控制台程序框架,包含依赖注入/配置/日志等要素
前言# 最近需要开发小工具的场景有点多,上次我用 go 语言开发了一个 hive 导出工具,体验还不错,只是 go 语言的语法实在是喜欢不起来,这次继续试试用 C# 来开发小工具。 这次小工具的功能很简单,数据库数据迁移,不过这不重要,主要是记录一下更适合 .Net Core 宝宝体质的控制台小工具 ......
开发一个现代化的.NetCore控制台程序,包含依赖注入/配置/日志等要素
前言 最近需要开发小工具的场景有点多,上次我用 go 语言开发了一个 hive 导出工具,体验还不错,只是 go 语言的语法实在是喜欢不起来,这次继续试试用 C# 来开发小工具。 这次小工具的功能很简单,数据库数据迁移,不过这不重要,主要是记录一下更适合 .Net Core 宝宝体质的控制台小工具开 ......
NETCore,离线部署Linux ,离线部署 libgdiplus
背景 错误信息:Unable to load shared library ‘libgdiplus‘ or one of its dependencies 解析:libgdiplus是Linux支持Netcore的图形库,比如System.Drawing要用,在线安装都容易,离线就处理起来恶心了 以 ......
NetCore 技术参考
开发平台 1、数据模型 2、数据视图 3、界面模型 4、系统图标接口开发 1、接口设置 2、联动设置 3、调用日志代码生成 1、BLL业务逻辑层 2、DAL数据访问层 3、Model实体层 4、生成报表模板 5、EF接口 6、EF业务逻辑层 7、EF数据访问层 8、EFModel模型数据配置 1、表 ......
NU1102 找不到版本为(=5.0.0-dev)的包 Microsoft.NETCore.App.Host.win-x64
异常: 原因:.Net Core 3.0 之后的版本,默认情况下项目在生成时,会自动生成与运行时版本相同的可执行文件(exe<Windows下>),它是需要对应版本的一个dotnet-apphost-pack包支持。 解决方法: 1.下载安装dotnet-apphost-pack包 2.禁用生成可执 ......
[MDP.NetCore] 開發一個從GitHub持續佈署到Azure Container Apps的Web站台
開發一個從GitHub持續佈署到Azure Container Apps的Web站台 程式碼簽入GitHub之後,啟動GitHub Action流程,編譯並部署程式到Azure Container Apps,是開發系統時常見的功能需求。本篇範例協助開發人員使用GitHub與Azure,逐步完成必要的 ......
NetCore之基于Azure Service Bus的消息服务
什么是Azure服务总线? Azure服务总线是完全托管的企业消息代理,包括消息队列和发布订阅(命名空间). Service Bus通常被用来解耦应用程序和服务,控制跨服务和应用程序间安全路由和传输数据。 本篇从实战出发介绍如何通过Service Bus发送接收及消费消息。 1、创建API.Azur ......
rabbitmq+mqtt+docker-compose搭建MQTT服务器和.netcore 客户端实现 订阅+发布
转自:https://blog.csdn.net/oopxiajun2011/article/details/130658329 1 搭建MQTT服务器 1.1 Dockerfile 内容 1 FROM rabbitmq:3.11.6-management 2 COPY install_rabbit ......
最简单的Docker部署.netcore webApi 一看就会
学会如何使用Docker部署.NET Core WebAPI 用vscode新建一个文件,文件名存为:dockerfile 不要后缀名 本地发布一下项目,然后把dockerfile放到发布后的目录里或则选择属性始终复制 创建完之后,发布一下,然后到publish文件夹下面新建个dockerfile, ......
NETCORE DockerFile
1.DockerFile配置 rm -rf Dockerfile cat>>Dockerfile<<EOF FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base # RUN apk add --no-cache icu-libs EXPOSE 80 EXP ......
.netCore调用WebService
![img](https://img2023.cnblogs.com/blog/18992/202310/18992-20231012143323708-1124209202.png) ![img](https://img2023.cnblogs.com/blog/18992/202310/1899... ......
.netframework迁移到.netcore方法
一 .netframework程序迁移到.netcore5.0对于.netframwork程序想要升级为.netcore5.0的方法,微软官方也给出了方法见 https://docs.microsoft.com/en-us/dotnet/desktop/winforms/migration/?vie ......
NetCore Ocelot 之 Cache
Ocelot supports some very rudimentary caching at the moment provider by the CacheManager project. This s an amazing project that is solving a lot of c ......
NetCore Ocelot 之 Authorization
Ocelot supports claims based authorization which is run post authentication. This means if ou have a route you want to authorize you can add the follo ......
NetCore Ocelot 之 Qos
Qos quality of service Ocelot supports one Qos capability at the current time.You can set on a per Route basis if you want to use a circuit breaker wh ......
NetCore Ocelot 之 Load Balancer
Ocelot can load balance across available downstream services for each Route. This means you can scale your downstream services and Ocelot can use them ......
NetCore Ocelot 之 Authentication
In order to authenticate Routes and subsequently use any of Ocelot's claims based features such as authorization or modifying the request with values ......
NetCore Ocelot 之 Rate Limiting
Ocelot supports rate limiting of upstream requests so that your downstream services do not become overloaded. OK so to get rate limiting working for a ......