File tree Expand file tree Collapse file tree 6 files changed +23
-97
lines changed
samples/Sample.RabbitMQ.MySql
src/DotNetCore.CAP.SqlServer Expand file tree Collapse file tree 6 files changed +23
-97
lines changed Original file line number Diff line number Diff line change 1- using System ;
2- using System . Data ;
3- using System . Threading . Tasks ;
1+ using System . Data ;
42using Dapper ;
53using DotNetCore . CAP ;
64using Microsoft . AspNetCore . Mvc ;
75using MySqlConnector ;
86
97namespace Sample . RabbitMQ . MySql . Controllers
108{
11-
129 [ Route ( "api/[controller]" ) ]
1310 public class ValuesController : Controller
1411 {
@@ -82,7 +79,6 @@ public void Subscriber(DateTime time)
8279 Console . WriteLine ( "Publishing time:" + time ) ;
8380 }
8481
85-
8682 [ NonAction ]
8783 [ CapSubscribe ( "sample.rabbitmq.test" ) ]
8884 public void Subscriber2 ( string message )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- using Microsoft . AspNetCore . Hosting ;
2- using Microsoft . Extensions . Hosting ;
1+ using Sample . RabbitMQ . MySql ;
32
4- namespace Sample . RabbitMQ . MySql
3+ var builder = WebApplication . CreateBuilder ( args ) ;
4+
5+ // Add services to the container
6+ builder . Services . AddDbContext < AppDbContext > ( ) ;
7+
8+ builder . Services . AddCap ( x =>
59{
6- public class Program
7- {
8- public static void Main ( string [ ] args )
9- {
10- CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
11- }
10+ x . UseEntityFramework < AppDbContext > ( ) ;
11+ x . UseRabbitMQ ( "localhost" ) ;
12+ x . UseDashboard ( ) ;
13+ } ) ;
14+
15+ builder . Services . AddControllers ( ) ;
16+
17+ var app = builder . Build ( ) ;
18+
19+ // Configure the HTTP request pipeline
20+ app . UseRouting ( ) ;
21+ app . MapControllers ( ) ;
1222
13- public static IHostBuilder CreateHostBuilder ( string [ ] args ) =>
14- Host . CreateDefaultBuilder ( args )
15- . ConfigureWebHostDefaults ( webBuilder =>
16- {
17- webBuilder . UseStartup < Startup > ( ) ;
18- } ) ;
19- }
20- }
23+ app . Run ( ) ;
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <TargetFramework >net8.0</TargetFramework >
5+ <ImplicitUsings >enable</ImplicitUsings >
56 </PropertyGroup >
67
78 <ItemGroup >
89 <PackageReference Include =" Dapper" Version =" 2.1.66" />
9- <PackageReference Include =" Microsoft.AspNetCore.Authentication.JwtBearer" Version =" 8.0.7" />
1010 <PackageReference Include =" Pomelo.EntityFrameworkCore.MySql" Version =" 8.0.3" />
11- <PackageReference Include =" Swashbuckle.AspNetCore" Version =" 9.0.3" />
1211 </ItemGroup >
1312 <ItemGroup >
14- <ProjectReference Include =" ..\..\src\DotNetCore.CAP.Dashboard.K8s\DotNetCore.CAP.Dashboard.K8s.csproj" />
1513 <ProjectReference Include =" ..\..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />
1614 <ProjectReference Include =" ..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" />
1715 <ProjectReference Include =" ..\..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" />
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88
99 <ItemGroup >
1010 <PackageReference Include =" Microsoft.EntityFrameworkCore.Relational" Version =" 8.0.18" />
11- <PackageReference Include =" Microsoft.Data.SqlClient" Version =" 6.1.0 " />
11+ <PackageReference Include =" Microsoft.Data.SqlClient" Version =" 6.0.2 " />
1212 <ProjectReference Include =" ..\DotNetCore.CAP\DotNetCore.CAP.csproj" />
1313 </ItemGroup >
1414
You can’t perform that action at this time.
0 commit comments