feat: 添加事件总线

This commit is contained in:
橙子
2023-02-19 20:57:31 +08:00
parent 1f33204697
commit dffdaa8d68
12 changed files with 126 additions and 12 deletions

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cike.EventBus" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\framework\Yi.Framework.Core\Yi.Framework.Core.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using StartupModules;
using Yi.Framework.Core.Helper;
namespace Yi.Framework.EventBus
{
public class YiFrameworkEventBusModule : IStartupModule
{
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
{
}
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
{
services.AddCikeEventBus(opt =>
{
opt.AddHandlerForAsemmbly(AssemblyHelper.GetAllLoadAssembly());
});
}
}
}