Procházet zdrojové kódy

Upgrade samples to .net core 2.1

master
Savorboard před 6 roky
rodič
revize
d8c96d8070
7 změnil soubory, kde provedl 8 přidání a 39 odebrání
  1. +1
    -1
      samples/Sample.Kafka.MySql/Controllers/ValuesController.cs
  2. +0
    -6
      samples/Sample.Kafka.MySql/Program.cs
  3. +3
    -12
      samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj
  4. +1
    -2
      samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs
  5. +0
    -6
      samples/Sample.RabbitMQ.MySql/Program.cs
  6. +3
    -9
      samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj
  7. +0
    -3
      samples/Sample.RabbitMQ.MySql/Startup.cs

+ 1
- 1
samples/Sample.Kafka.MySql/Controllers/ValuesController.cs Zobrazit soubor

@@ -34,7 +34,7 @@ namespace Sample.Kafka.MySql.Controllers
return Ok("publish successful!");
}

[CapSubscribe("xxx.xxx.test2")]
[CapSubscribe("#.test2")]
public void Test2(int value)
{
Console.WriteLine("Subscriber output message: " + value);


+ 0
- 6
samples/Sample.Kafka.MySql/Program.cs Zobrazit soubor

@@ -1,6 +1,5 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using NLog.Web;

namespace Sample.Kafka.MySql
{
@@ -15,11 +14,6 @@ namespace Sample.Kafka.MySql
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureLogging((hostingContext, builder) =>
{
hostingContext.HostingEnvironment.ConfigureNLog("nlog.config");
})
.UseNLog()
.Build();
}
}

+ 3
- 12
samples/Sample.Kafka.MySql/Sample.Kafka.MySql.csproj Zobrazit soubor

@@ -1,29 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>Sample.Kafka.MySql</AssemblyName>
<WarningsAsErrors>NU1701</WarningsAsErrors>
<NoWarn>NU1701</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="MySqlConnector" Version="0.40.3" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DotNetCore.CAP.Kafka\DotNetCore.CAP.Kafka.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP.MySql\DotNetCore.CAP.MySql.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="nlog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>

+ 1
- 2
samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs Zobrazit soubor

@@ -25,7 +25,6 @@ namespace Sample.RabbitMQ.MySql.Controllers
return Ok();
}


[Route("~/publish2")]
public IActionResult PublishMessage2()
{
@@ -47,7 +46,7 @@ namespace Sample.RabbitMQ.MySql.Controllers
}

[NonAction]
[CapSubscribe("sample.rabbitmq.mysql")]
[CapSubscribe("#.rabbitmq.mysql")]
public void ReceiveMessage(DateTime time)
{
Console.WriteLine("[sample.rabbitmq.mysql] message received: " + DateTime.Now + ",sent time: " + time);


+ 0
- 6
samples/Sample.RabbitMQ.MySql/Program.cs Zobrazit soubor

@@ -1,6 +1,5 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using NLog.Web;

namespace Sample.RabbitMQ.MySql
{
@@ -14,11 +13,6 @@ namespace Sample.RabbitMQ.MySql
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureLogging((hostingContext, builder) =>
{
hostingContext.HostingEnvironment.ConfigureNLog("nlog.config");
})
.UseNLog()
.Build();
}
}

+ 3
- 9
samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj Zobrazit soubor

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -10,9 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.2" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.0-rc1-final" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
@@ -22,10 +21,5 @@
<ProjectReference Include="..\..\src\DotNetCore.CAP.RabbitMQ\DotNetCore.CAP.RabbitMQ.csproj" />
<ProjectReference Include="..\..\src\DotNetCore.CAP\DotNetCore.CAP.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="nlog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>

+ 0
- 3
samples/Sample.RabbitMQ.MySql/Startup.cs Zobrazit soubor

@@ -23,9 +23,6 @@ namespace Sample.RabbitMQ.MySql

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
loggerFactory.AddDebug();

app.UseMvc();

app.UseCap();


Načítá se…
Zrušit
Uložit