JoreNoe 7.4.9

dotnet add package JoreNoe --version 7.4.9                
NuGet\Install-Package JoreNoe -Version 7.4.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JoreNoe" Version="7.4.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JoreNoe --version 7.4.9                
#r "nuget: JoreNoe, 7.4.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JoreNoe as a Cake Addin
#addin nuget:?package=JoreNoe&version=7.4.9

// Install JoreNoe as a Cake Tool
#tool nuget:?package=JoreNoe&version=7.4.9                

🎉 JoreNoe Package

📖 线上文档

📦 安装方法

Build NuGet Downloads CreateTime Laster Commit
.NET Version alternate text is missing from this package README image <a href="https://www.nuget.org/packages/JoreNoe/" rel="nofollow noreferrer"><img src="https://img.shields.io/nuget/dt/JoreNoe?logo=nuget&label=Downloads" alt="NuGet Downloads"></a> alternate text is missing from this package README image GitHub last commit
Install-Package JoreNoe -Version Laster
install-package Jorenoe -version 7.4.6

📂 文档目录

ORM使用
Redis扩展如何使用
发送Email消息扩展如何使用
辅助开发帮助类或者函数如何使用
NetCore中间件使用
RabbitMQ如何使用

ORM使用说明

JoreNoe包目前支持数据库:Mysql , SqlServer

支持,ORM框架 Dapper,EFCore

<a name="OPT1-1"></a>

🏗 1. Dapper 使用指南

📌 第一步:引用依赖

在代码中引入 JoreNoe.DB.Dapper,确保 Dapper 能够正确使用。

using JoreNoe.DB.Dapper;

🛠 第二步:注册 Dapper 服务

在应用程序启动时,将 Dapper 添加到 依赖注入容器
Startup.cs 文件中的 ConfigureServices 方法中,调用 AddJoreNoeDapper 进行注册:

public void ConfigureServices(IServiceCollection services)
{
    services.AddJoreNoeDapper("your_connection_string_here", IDBType.SqlServer);
    // 或者
    services.AddJoreNoeDapper("your_connection_string_here", IDBType.MySql);
}

🔹 最新版本支持 单库 & 多库模式

单库模式
// 单个模式注入
builder.Services.AddJoreNoeDapper("your_connection_string_here", IDBType.MySql, true);
多库模式
// 多个模式注入
builder.Services.AddJoreNoeDapper(
    new List<DatabaseSettings>
    {
        new DatabaseSettings("your_connection_string_here", IDBType.MySql, true,
        AvailableTables: new List<string> { "User" }), // 绑定 User 表

        new DatabaseSettings("your_connection_string_here", IDBType.MySql, true,
        AvailableTables: new List<string> { "test" }) // 绑定 test 表
    }
);

🚀 第三步:使用 Dapper 服务

🔹 在业务逻辑中使用 Repository

public class YourService
{
    private readonly IRepository<test> TestRepository;

    public YourService(IRepository<test> TestRepository)
    {
        this.TestRepository = TestRepository;
    }

    public void YourMethod()
    {
        this.TestRepository.Add(new test { ... });
    }
}

🔍 获取数据库属性

public class YourService
{
    private readonly IDatabaseService dataBaseService;

    public YourService(IDatabaseService dataBaseService)
    {
        this.dataBaseService = dataBaseService;
    }

    public IDbConnection GetConnection()
    {
        return this.dataBaseService.GetConnection(); // 获取数据库连接
    }
    
    public string GetPropValue()
    {
        return this.dataBaseService.DataBaseSettings.connectionString;  // 数据库连接字符串
        return this.dataBaseService.DataBaseSettings.dbType;            // 数据库类型
        return this.dataBaseService.DataBaseSettings.mulitInsertBatchcount; // 批量插入时每批数量
    }
}

❌ 不使用依赖注入方式(手动创建实例)

如果不想使用 依赖注入(DI),可以手动创建 Repository 实例:

public class UserController
{
    var database = new Repository<test>(new DatabaseService("your_connection_string_here", IDBType.MySql, 200000));
    database.Add(new test { ... });
}

✅ 总结:

  • 支持单库 & 多库模式
  • 支持依赖注入 & 手动实例化
  • 提供数据库连接 & 批量插入配置
  • 便捷的 Repository 操作,提升开发效率

🚀 Dapper + JoreNoe 让数据操作更简单! 🎯

<a name="OPT1-2"></a>

🏗 2. EntityFramework.Core 使用指南

📌 第一步:项目结构

仓储项目 中创建以下文件:

1. RepositoryModule.cs
2. IntegratedPlatformSupporRegister.cs  // 名称可自定义

数据访问层 中创建 DbContext 文件:

3. IntegratedPlatformSupporDBContext.cs  // 名称可自定义

🛠 第二步:代码实现

1️⃣ RepositoryModule.cs - 依赖注入模块

using Autofac;
using JoreNoe;
using JoreNoe.DB.EntityFrameWork.Core.SqlServer;

namespace IntegratedPlatformSuppor.Repository
{
    public class RepositoryModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<IntegratedPlatformSupporRegister>().As<ICurrencyRegister>().InstancePerLifetimeScope();
            builder.RegisterGeneric(typeof(Repository<,>)).As(typeof(IRepository<,>));
            builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
        }
    }
}

2️⃣ IntegratedPlatformSupporRegister.cs - 注册 DbContext

using JoreNoe;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;

namespace IntegratedPlatformSuppor.Repository
{
    public class IntegratedPlatformSupporRegister : ICurrencyRegister, IDisposable
    {
        private DbContext _dbContext;

        public IntegratedPlatformSupporRegister(IConfiguration Configuration)
        {
            this._dbContext = new IntegratedPlatformSupporDBContext { Configuration = Configuration };
        }

        public DbContext Dbcontext { get => this._dbContext; set { this._dbContext = value; } }

        public void Dispose()
        {
            this._dbContext.Dispose();
        }
    }
}

3️⃣ IntegratedPlatformSupporDBContext.cs - 数据库上下文

using IntegratedPlatformSuppor.Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;

namespace IntegratedPlatformSuppor.Repository
{
    public class IntegratedPlatformSupporDBContext : DbContext
    {
        public IntegratedPlatformSupporDBContext() { }

        public IConfiguration Configuration { set; get; }

        public DbSet<User> Users { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            var connStr = this.Configuration.GetConnectionString("DbConnect");
            optionsBuilder.UseSqlServer(string.IsNullOrEmpty(connStr) ? "Server=47.106.198.147;Database=IntegratedPlatformSuppor;Uid=sa;Password=JoreNoe123$%^" : connStr);
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Test>().HasQueryFilter(t => t.IsDelete == false);
            modelBuilder.Entity<User>().HasQueryFilter(t => t.IsDelete == false);
            modelBuilder.Entity<MeansCategory>().HasQueryFilter(d => !d.IsDelete);
        }
    }
}

🔹 第三步:注册 AutoFac 依赖

在项目根目录创建 Autofac.json,调整模块配置:

{
  "modules": [
    { "type": "IntegratedPlatformSuppor.Repository.RepositoryModule,IntegratedPlatformSuppor.Repository" },
    { "type": "IntegratedPlatformSuppor.API.APIModule,IntegratedPlatformSuppor.API" },
    { "type": "IntegratedPlatformSuppor.DomainService.DomainServiceModule,IntegratedPlatformSuppor.DomainService" }
  ]
}

1️⃣ WebApi 项目 Program.cs 配置

using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System.IO;

namespace IntegratedPlatformSuppor.API
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
             Host.CreateDefaultBuilder(args)
             .UseServiceProviderFactory(new AutofacServiceProviderFactory())
             .ConfigureAppConfiguration((appConfiguration, builder) =>
             {
                 builder.SetBasePath(Directory.GetCurrentDirectory())
                        .AddJsonFile("Configs/Redis.json", optional: false, reloadOnChange: true)
                        .AddJsonFile("Configs/Exceptionless.json", optional: false, reloadOnChange: true)
                        .AddJsonFile("Configs/WeChatOpenConfig.json", optional: false, reloadOnChange: true)
                        .AddEnvironmentVariables().Build();
             })
             .ConfigureWebHostDefaults(webBuilder =>
             {
                 webBuilder.UseStartup<Startup>();
                 webBuilder.UseUrls("http://*:5000");
             });
    }
}

2️⃣ 在 Startup.cs 里注册 AutoFac

public void ConfigureContainer(ContainerBuilder builder)
{
    var config = new ConfigurationBuilder();
    config.AddJsonFile("./Configs/Autofac.json");
    builder.RegisterModule(new ConfigurationModule(config.Build()));
}

🚀 实战使用示例

public class testDomainService : BaseRepository, ItestDomainService
{
    private readonly IRepository<Guid, Test> _testRepository;

    public testDomainService(IRepository<Guid, Test> testRepository, IUnitOfWork unit) : base(unit)
    {
        _testRepository = testRepository;
    }

    public TestValue GetTest()
    {
        return _testRepository.Single(Guid.NewGuid());
    }
}

✅ 总结

  • 支持 AutoFac 依赖注入,模块化管理依赖
  • 统一管理数据库上下文,支持多数据库配置
  • 提供自动查询过滤器,提升数据查询效率
  • 可扩展性强,适用于企业级应用

🚀 EFCore + JoreNoe 让数据访问更简单高效! 🎯

<a name="OPT2"></a>

3. 🏗 Redis 使用说明

如何使用

1. 注入 JoreNoe Redis 中注册上下文

📌 步骤 1:注入 Redis

public void ConfigureServices(IServiceCollection services)
{
    services.AddJoreNoeRedis("your_connection_string_here", "InstanceName", DefaultDB = 0);
}

 🔧 **步骤 2: 如何使用Redis**

```C#
using  JoreNoe.Cache.Redis;
public class RedisTest
{
    private readonly JoreNoe.Cache.Redis.IRedisManager ReadisManager;
    public RedisTest(JoreNoe.Cache.Redis.IRedisManager ReadisManager) {
        this.ReadisManager = ReadisManager;
    }

    public void test()
    {
        this.ReadisManager.Add("Test", "test", JoreNoe.Cache.Redis.ExpireModel.LongCache);

        Console.WriteLine(this.ReadisManager.Get("Test"));
    }
}

🔗 步骤3:手动创建实例并调用

JoreNoe.Cache.Redis.JoreNoeRedisBaseService RedisDataBase = new JoreNoe.Cache.Redis.JoreNoeRedisBaseService(new JoreNoe.Cache.Redis.SettingConfigs {
    ConnectionString= "localhost:6379,password=mima",
    DefaultDB=1,
    InstanceName="TestRedis"
});

JoreNoe.Cache.Redis.IRedisManager RedisManager = new JoreNoe.Cache.Redis.RedisManager(RedisDataBase);

RedisManager.Add("Test","test", JoreNoe.Cache.Redis.ExpireModel.LongCache);

Console.WriteLine(RedisManager.Get("Test"));

Console.ReadLine();

<a name="OPT3"></a>

🏗 4.发送消息

📧目前支持:Email

📌1.邮箱发送

如何使用

using JoreNoe.Message;
public class test{
    public void sendtest(){
        // 首先注册 
        var EmailHelper = new EmailMessageAPI(发送者,SMTP地址,SMTP端口,密码(个人是授权码),是否开启SSL认证);
        EmailHelper.Send(收件人,标题,主题内容,是否开启兼容HTML);
    }
}

<a name="OPT4"></a>

🏗 5.帮助扩展方法

🚀支持:boolean,字典转SQL,映射,实体转字典,Resolve扩展

🔗1.bool 扩展方法

using JoreNoe.Extend;

public class test{
    
    public void sendtest(){

         /// <summary>
 /// 可用枚举类型 默认 1
 /// 类型1:IsOrDeny 是 否
 /// 类型2:TrueOrFalse 真 假
 /// 类型3:OnOrOff 开 关 
 /// 类型4:EnableOrDisable 启用 关闭
 /// </summary>
        
        var booltest = false;
         var REsult = booltest.BooleanToString(AvailableType.IsOrDeny);
        // 输出 否
        
    }
}

🔗2.映射(AutoMapper)

// 直接使用方式 
var config = new MapperConfiguration(cfg =>
{
    cfg.CreateMap<test, test1>();
    cfg.CreateMap<test1, test>();
});
var mapper = new Mapper(config);
JoreNoe.Extend.JoreNoeObjectToObjectExtension.UseJoreNoeObjectToOBject(mapper);
var test = new test() {
    name = "c",
    age=123
};
var test1 = new test1();
// 将 test 数据 给 test1
var ment = test.Map(test1);
Console.ReadLine();

// NET 使用方式
// StartUp 
 public partial class Startup
    {
        protected void AddAutoMapper(IServiceCollection services)
        {
            services.TryAddSingleton<MapperConfigurationExpression>();
            services.TryAddSingleton(serviceProvider =>
            {
                var mapperConfigurationExpression = serviceProvider.GetRequiredService<MapperConfigurationExpression>();
                var instance = new MapperConfiguration(mapperConfigurationExpression);
                
                instance.AssertConfigurationIsValid();
                return instance;
            });
            services.TryAddSingleton(serviceProvider =>
            {
                var mapperConfiguration = serviceProvider.GetRequiredService<MapperConfiguration>();
                return mapperConfiguration.CreateMapper();
            });
        }
        public void UseAutoMapper(IApplicationBuilder applicationBuilder)
        {
            var config = applicationBuilder.ApplicationServices.GetRequiredService<MapperConfigurationExpression>();
            
            //订单
            config.CreateMap<OrderModel, Order>(MemberList.None);
            config.CreateMap<Order, OrderValue>(MemberList.None);

            //config.CreateMap<User, UserInfo>().ForMember(d => d.names, option => option.MapFrom(d => d.name)).ReverseMap();
        }
     
     
     // Program
      public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
             Host.CreateDefaultBuilder(args)
             .UseServiceProviderFactory(new AutofacServiceProviderFactory())
             .ConfigureAppConfiguration((appConfiguration, builder) =>
             {
                 builder
               .SetBasePath(Directory.GetCurrentDirectory())
               .AddJsonFile("Configs/Redis.json", optional: false, reloadOnChange: true)
               .AddJsonFile("Configs/Exceptionless.json", optional: false, reloadOnChange: true)
               .AddJsonFile("Configs/WeChatOpenConfig.json", optional: false, reloadOnChange: true)
               .AddEnvironmentVariables().Build();
             })
             .ConfigureWebHostDefaults(webBuilder =>
             {
                 webBuilder.UseStartup<Startup>();
                 webBuilder.UseUrls("http://*:5000");
             });
     
     
     // StartUp Configure 中  
     public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment() || env.IsProduction())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ZerroMovies.API v1"));
            }
            app.UseObjectToOBjectExtension();
        }

🔗3.Resolve扩展

// 在程序启动时设置容器工厂
AutofacResolver.SetContainerFactory(() => container);

// 在需要解析依赖项的地方使用 AutofacResolver
var service = AutofacResolver.Resolve<IMyService>();

🔗4.网络请求HttpClientAPI

🔗4.1注入方式

// 注入 在 StartUp 或者 (NEt6以上在Program中注册)
 services.AddHttpClientApi();

//使用Demo
using Microsoft.AspNetCore.Mvc;
using JoreNoe.JoreHttpClient; // 引入你的命名空间

namespace MyApp.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class TestController : ControllerBase
    {
        private readonly HttpClientApi _httpClientApi;

        public TestController(HttpClientApi httpClientApi)
        {
            _httpClientApi = httpClientApi;
        }

        [HttpGet("get")]
        public async Task<IActionResult> Get()
        {
            try
            {
                var response = await _httpClientApi.GetAsync("https://api.example.com/data");
                return Ok(response);
            }
            catch (HttpRequestException ex)
            {
                return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
            }
        }

        [HttpPost("post")]
        public async Task<IActionResult> Post([FromBody] string content)
        {
            try
            {
                var response = await _httpClientApi.PostAsync("https://api.example.com/data", content);
                return Ok(response);
            }
            catch (HttpRequestException ex)
            {
                return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
            }
        }
    }
}

🔗4.2 直接使用方式

 // 创建 HttpClientHandler(可以配置 SSL 验证等)
var handler = new HttpClientHandler
{
    // 例如:禁用 SSL 证书验证
    ServerCertificateCustomValidationCallback = (message, cert, chain, sslPolicyErrors) => true
};

// 创建 HttpClient 实例
var httpClient = new HttpClient(handler)
{
    BaseAddress = new Uri("https://api.example.com/")
};

// 创建 IHttpClientFactory 的模拟实现
var httpClientFactory = new FakeHttpClientFactory(httpClient);

// 创建 HttpClientApi 实例
var httpClientApi = new HttpClientApi(httpClientFactory);

// 使用 HttpClientApi 发送请求
try
{
    var response = await httpClientApi.GetAsync("data");
    Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}

🔗5.Swagger暗黑主题

app.UseSwagger();
app.UseJoreNoeSwaggerThemeDark(); // 注入
   app.UseSwaggerUI(option =>
   {
       option.InjectStylesheet(SwaggerThemsExtend.DarkTheme); // 注入主题地址
       
       option.SwaggerEndpoint("/swagger/v1/swagger.json", "v1");
       option.SwaggerEndpoint("/swagger/v2/swagger.json", "v2");

   });

<a name="OPT5"></a>

🚀 6.中间件的使用

🔗1.全局错误日志中间件

// 使用方式1 webapi 全局错误日志中间件  直接使用方式
app.UseJoreNoeGlobalErrorHandlingMiddleware(async (ex, context) =>
{
    // 返回错误信息 // 处理自己的数据
    await Console.Out.WriteLineAsync(ex.Message);
});


// 使用方式2 注入 自定义类继承使用方式
builder.Services.AddJoreNoeGlobalErrorHandlingMiddleware<TestErrorMiddleWare>();
app.UseJoreNoeGlobalErrorHandlingMiddleware();
// 使用案例
using JoreNoe.Middleware;

namespace TestNET6Project
{
    public class TestErrorMiddleWare : IJoreNoeGlobalErrorHandling
    {
        public async Task GlobalErrorHandling(Exception Ex)
        {
            await Console.Out.WriteLineAsync(JoreNoeRequestCommonTools.FormatError(Ex));
        }
    }
}

🔗2.全局运行日志中间件

// webapi 全局运行日志中间件  直接使用方式
app.UseJoreNoeRequestLoggingMiddleware(info => {
    Console.WriteLine("方法"+info.Method);
    Console.WriteLine("路径" + info.Path);
    Console.WriteLine("开始时间" + info.StartTime);
    Console.WriteLine("总时长" + info.Duration);
    Console.WriteLine("Get请求参数" + info.QueryString);
    Console.WriteLine("BODY请求参数" + info.RequestBody);
    Console.WriteLine("完整路径" + info.FullPathUrl);
    Console.WriteLine("Headers" + info.Headers);
});

// 注入 自定义类继承使用方式
builder.Services.AddJoreNoeRequestLoggingMiddleware<TestMiddleWare>();
app.UseJoreNoeRequestLoggingMiddleware();
// 使用案例
using JoreNoe.Middleware;

namespace TestNET6Project
{
    public class TestMiddleWare : IJorenoeRuningRequestLogging
    {
        public async Task RunningRequestLogging(JorenoeRuningRequestLoggingModel info)
        {
            Console.WriteLine("方法" + info.Method);
            Console.WriteLine("路径" + info.Path);
            Console.WriteLine("开始时间" + info.StartTime);
            Console.WriteLine("总时长" + info.Duration);
            Console.WriteLine("Get请求参数" + info.QueryString);
            Console.WriteLine("BODY请求参数" + info.RequestBody);
            Console.WriteLine("完整路径" + info.FullPathUrl);
            Console.WriteLine("Headers" + info.Headers);
        }
    }
}

🔗3.全局方法控制中间件

📌 中间件说明

该中间件依赖于 Redis,在项目启动时,会将所有 控制器方法 写入 Redis,默认存储格式如下:

  • Key控制器/方法名
  • Value:
    • true:可用状态 ✅(正常访问)
    • false:不可用状态 ❌(请求将直接返回预设内容,如 “拒绝访问”)

⚙️ 配置项

  • LocalCacheDurationInMinutes:本地缓存有效时间,默认 30 分钟,可根据需求自行调整。
  • ReturnMessage:被拒绝后响应的内容,默认为:"Access Denied",可自定义设置,支持HTML
// 使用方式 在 Prgrame 中 
builder.Services.AddJoreNoeJoreNoeIntefaceAccessMiddleware(LocalCacheDurationInMinutes: TimeSpan.FromMinutes(5)
                                                           ,"拒绝请求内容,支持HTML");

app.UseJoreNoeIntefaceAccessMiddleware();

🔗4.全局IP请求控制中间件

📌 中间件说明

该中间件依赖于 Redis,在项目启动时,会将 非法请求的IP 写入 Redis,默认存储格式如下:

  • KeyProjectBlackLists
  • Value:[127.0.0.1]:❌(请求将直接返回预设内容)
  • 默认返回内容存储在Reids中key如下
  • Key:DeniedReturnMessage

⚙️ 配置项

  • maxRequestCount:每spanTime/ 多少次 ,必填
  • spanTime:spanTime内支持请求多少次,同一个IP,必填
  • TimeSpanLocalCache:本地缓存时间,拒绝访问响应内容和黑名单IP存储
  • isEnabledRequestLimit:是否启用计数限制,如启用将在每spantime=1分钟/maxRequestCount=100次,每分钟请求超过一百次后记录次IP拒绝访问,如不启用将不进行限制,可手动添加黑名单到Reids数组中
builder.Services.AddJoreNoeSystemIPBlackListMiddleware(300, TimeSpan.FromSeconds(60), TimeSpan.FromMinutes(6), true);
app.UseJoreNoeSystemIPBlackListMiddleware();

<a name="OPT6"></a>

🚀 7.RabbitMQ使用

🔗1.初始化

 // 在Program  或者 StrartUp 中 进行初始化
 // 加入RabbitMQ 外部使用 监控使用 特殊用法
 JoreNoe.Queue.RBMQ.Register.RegisterQueue("Ip", "账户", "密码", "/虚机", "队列名称");
 // 例子
 JoreNoe.Queue.RBMQ.Register.RegisterQueue("124.70.12.123", "jorenoe", "jorenoe", "/", "Moitoring");

📌注意 如果只推送 不接受按照第一步初始化即可,如果需要接受请按一下配置
JoreNoe.Queue.RBMQ.Register.RegisterQueue("124.70.12.123", "jorenoe", "jorenoe", "/", "Moitoring");
QueueManager.Receive<MoitoringEvent>(new CustomerRabbitMQ(), "Moitoring");// 增加一条接受配置

 public class CustomerRabbitMQ : ICustome<MoitoringEvent>
    {
        public async Task<MoitoringEvent> ConSume(CustomeContent<MoitoringEvent> Context)
        {
            MessageBox.Show(Context.Context.SID);
            return null;
        }
    }

🔗2.使用 推送 和 接受

public class MoitoringEvent
{
    /// <summary>
    /// 设备ID
    /// </summary>
    public string SID { get; set; }

    /// <summary>
    /// 上线还是下线
    /// </summary>
    public string Type { get; set; }
}


// 推送
QueueManager.SendPublish<MoitoringEvent>(new MoitoringEvent { SID = SID,Type= Type });

// 接收
 public class CustomerRabbitMQ : ICustome<MoitoringEvent>
    {
        public async Task<MoitoringEvent> ConSume(CustomeContent<MoitoringEvent> Context)
        {
            MessageBox.Show(Context.Context.SID);
            return null;
        }
    }

📜 版权声明

版权所有 © JoreNoe。保留所有权利。

📞 联系方式

📧 Email: jorenoe@163.com
🌍 官网: JoreNoe 官方网站


JoreNoe 感谢您的支持!🚀

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.4.9 0 3/28/2025
7.4.8 60 3/26/2025
7.4.7 24,991 3/5/2025
7.4.7-test 182 3/5/2025
7.4.6 78,547 2/28/2025
7.4.5 7,236 2/27/2025
7.4.4 7,281 2/19/2025
7.4.3 7,080 2/19/2025
7.4.2 7,161 2/18/2025
7.3.6 40,666 2/12/2025
7.3.5 7,417 2/12/2025
7.3.4 7,464 2/12/2025
7.3.2 7,311 2/12/2025
7.3.1 7,459 1/21/2025
7.3.0 7,291 1/15/2025
7.2.9 7,336 12/24/2024
7.2.8 7,089 12/24/2024
7.2.7 7,394 12/19/2024
7.2.6 7,277 12/10/2024
7.2.5 7,372 11/27/2024
7.2.4 7,452 11/27/2024
7.2.3 7,441 11/25/2024
7.2.1 7,409 11/25/2024
7.2.0 7,315 11/25/2024
7.1.9 7,334 11/22/2024
7.1.8 7,230 11/22/2024
7.1.7 7,365 11/22/2024
7.1.6 25,274 11/20/2024
7.1.5 7,198 11/20/2024
7.1.4 7,437 11/20/2024
7.1.3 7,331 10/31/2024
7.1.2 24,046 10/18/2024
7.1.1 7,463 10/18/2024
7.1.0 7,301 10/17/2024
7.0.9 7,188 10/16/2024
7.0.8 7,331 10/15/2024
7.0.7 7,399 10/15/2024
7.0.6 7,429 10/15/2024
7.0.5 7,349 10/14/2024
7.0.4 7,335 10/14/2024
7.0.3 7,289 10/14/2024
7.0.2.2 7,327 10/14/2024
7.0.2.1 7,651 10/12/2024
7.0.2 7,371 10/12/2024
7.0.1.9 7,286 9/15/2024
7.0.1.8 7,391 9/15/2024
7.0.1.7 7,495 9/15/2024
7.0.1.6 23,578 9/15/2024
7.0.1.5 7,249 9/14/2024
7.0.1.4 7,261 9/14/2024
7.0.1.3 7,338 9/14/2024
7.0.1.2 7,580 9/14/2024
7.0.1.1 7,300 7/5/2024
7.0.1 7,362 7/3/2024
7.0.0.9 7,575 5/31/2024
7.0.0.8 7,541 5/31/2024
7.0.0.7 7,470 5/31/2024
7.0.0.6 7,400 5/31/2024
7.0.0.5 7,395 5/29/2024
7.0.0.4 7,320 5/29/2024
7.0.0.3 7,344 5/29/2024
7.0.0.2 7,431 5/27/2024
7.0.0.1 7,489 5/26/2024
6.9.9.9 7,302 5/26/2024
6.9.9.8 7,500 4/24/2024
6.9.9.7 7,393 4/24/2024
6.9.9.6 24,146 4/23/2024
6.9.9.5 7,345 4/23/2024
6.9.9.4 7,421 4/18/2024
6.9.9.3 7,381 4/16/2024
6.9.9.2 7,558 4/12/2024
6.9.9.1 7,634 4/11/2024
6.9.9 25,208 4/1/2024
6.9.7 7,519 4/1/2024
6.9.6 7,392 3/30/2024
6.7.7 7,407 12/28/2023
6.7.6 7,349 12/28/2023
6.7.5 7,383 11/3/2023
6.7.4 7,379 10/26/2023
6.7.3 7,302 10/26/2023
6.7.2 7,320 10/25/2023
6.7.1 7,388 10/25/2023
6.7.0 7,411 4/9/2023
6.6.9 25,168 4/5/2023
6.6.8 7,540 3/11/2023
6.5.8 7,818 7/30/2022
6.5.7 7,762 7/30/2022
6.5.6 7,677 7/29/2022
6.5.5 7,815 6/30/2022
6.5.4 7,852 6/28/2022
6.5.3 7,729 6/28/2022
6.5.2 7,802 6/28/2022
6.5.1 7,982 6/28/2022
6.5.0 7,864 6/27/2022
6.4.9 7,887 6/18/2022
6.4.8 7,750 6/17/2022
6.4.7 7,778 6/17/2022
6.4.6 7,866 6/17/2022
6.3.6 7,894 6/17/2022
6.3.4 7,783 6/17/2022
6.3.3 7,799 6/17/2022
6.3.2 7,934 6/17/2022
6.3.0 7,823 6/9/2022
6.2.0 7,811 6/8/2022
6.1.9 7,787 6/8/2022
6.1.8 7,895 6/7/2022
6.1.7 7,976 5/12/2022
6.1.6 7,841 5/12/2022
6.1.5 7,793 5/10/2022
6.1.4 7,857 5/10/2022
6.1.3 7,837 5/9/2022
6.1.2 7,756 5/9/2022
6.1.1 7,882 4/30/2022
6.1.0 7,750 4/30/2022
6.0.9 8,079 4/30/2022
6.0.8 7,833 4/30/2022
6.0.7 7,813 4/28/2022
6.0.6 7,812 4/28/2022
6.0.5 7,909 4/27/2022
6.0.4 7,808 4/27/2022
6.0.3 7,778 4/17/2022
6.0.2 7,843 4/17/2022
6.0.1 7,737 4/16/2022
6.0.0 25,427 4/16/2022
5.1.8 7,780 4/16/2022
5.1.7 7,688 4/16/2022
5.1.6 7,491 4/16/2022
5.1.5 7,802 4/16/2022
5.1.4 7,767 4/16/2022
5.1.3 7,710 4/16/2022
5.1.2 7,756 4/13/2022
5.1.1 7,621 10/22/2021
5.1.0 7,610 10/11/2021
5.0.9 7,701 9/23/2021
5.0.8 7,786 9/23/2021
5.0.7 7,737 9/23/2021
5.0.6 7,710 9/16/2021
5.0.5 7,516 9/15/2021
5.0.4 7,807 9/15/2021
5.0.3 7,467 9/15/2021
5.0.1 7,569 9/7/2021
5.0.0 7,628 9/3/2021
4.1.7 7,596 8/31/2021
4.1.6 24,438 8/31/2021
4.1.5 7,491 8/31/2021
4.1.4 7,583 8/31/2021
4.1.3 7,568 8/31/2021
4.1.2 7,518 8/31/2021
4.1.1 7,572 8/31/2021
1.0.5 7,623 8/18/2021
1.0.3 7,793 8/18/2021
1.0.2 7,587 8/18/2021
1.0.1 7,753 8/18/2021
1.0.0 25,421 8/18/2021
0.1.1 24,118 8/31/2021