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 ;
4
2
using Dapper ;
5
3
using DotNetCore . CAP ;
6
4
using Microsoft . AspNetCore . Mvc ;
7
5
using MySqlConnector ;
8
6
9
7
namespace Sample . RabbitMQ . MySql . Controllers
10
8
{
11
-
12
9
[ Route ( "api/[controller]" ) ]
13
10
public class ValuesController : Controller
14
11
{
@@ -82,7 +79,6 @@ public void Subscriber(DateTime time)
82
79
Console . WriteLine ( "Publishing time:" + time ) ;
83
80
}
84
81
85
-
86
82
[ NonAction ]
87
83
[ CapSubscribe ( "sample.rabbitmq.test" ) ]
88
84
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 ;
3
2
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 =>
5
9
{
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 ( ) ;
12
22
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 2
2
3
3
<PropertyGroup >
4
4
<TargetFramework >net8.0</TargetFramework >
5
+ <ImplicitUsings >enable</ImplicitUsings >
5
6
</PropertyGroup >
6
7
7
8
<ItemGroup >
8
9
<PackageReference Include =" Dapper" Version =" 2.1.66" />
9
- <PackageReference Include =" Microsoft.AspNetCore.Authentication.JwtBearer" Version =" 8.0.7" />
10
10
<PackageReference Include =" Pomelo.EntityFrameworkCore.MySql" Version =" 8.0.3" />
11
- <PackageReference Include =" Swashbuckle.AspNetCore" Version =" 9.0.3" />
12
11
</ItemGroup >
13
12
<ItemGroup >
14
- <ProjectReference Include =" ..\..\src\DotNetCore.CAP.Dashboard.K8s\DotNetCore.CAP.Dashboard.K8s.csproj" />
15
13
<ProjectReference Include =" ..\..\src\DotNetCore.CAP.Dashboard\DotNetCore.CAP.Dashboard.csproj" />
16
14
<ProjectReference Include =" ..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" />
17
15
<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 8
8
9
9
<ItemGroup >
10
10
<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 " />
12
12
<ProjectReference Include =" ..\DotNetCore.CAP\DotNetCore.CAP.csproj" />
13
13
</ItemGroup >
14
14
You can’t perform that action at this time.
0 commit comments