Browse Source

update samples.

undefined
Savorboard 7 years ago
parent
commit
097145d49d
15 changed files with 34 additions and 58 deletions
  1. +2
    -2
      samples/Sample.Kafka.SqlServer/AppDbContext.cs
  2. +1
    -1
      samples/Sample.Kafka.SqlServer/Startup.cs
  3. +2
    -2
      samples/Sample.RabbitMQ.MySql/AppDbContext.cs
  4. +1
    -1
      samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj
  5. +1
    -5
      samples/Sample.RabbitMQ.MySql/Startup.cs
  6. +1
    -1
      samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs
  7. +3
    -7
      samples/Sample.RabbitMQ.PostgreSql/Startup.cs
  8. +2
    -2
      samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs
  9. +2
    -15
      samples/Sample.RabbitMQ.SqlServer/Program.cs
  10. +6
    -9
      samples/Sample.RabbitMQ.SqlServer/Startup.cs
  11. +1
    -1
      src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj
  12. +4
    -4
      test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj
  13. +2
    -2
      test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj
  14. +3
    -3
      test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj
  15. +3
    -3
      test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj

+ 2
- 2
samples/Sample.Kafka.SqlServer/AppDbContext.cs View File

@@ -7,8 +7,8 @@ namespace Sample.Kafka.SqlServer

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=Sample.Kafka.SqlServer;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True");
// optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True");
//optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=Sample.Kafka.SqlServer;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True");
optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True");
}
}
}

+ 1
- 1
samples/Sample.Kafka.SqlServer/Startup.cs View File

@@ -15,7 +15,7 @@ namespace Sample.Kafka.SqlServer
services.AddCap(x =>
{
x.UseEntityFramework<AppDbContext>();
x.UseKafka("192.168.2.227:9091,192.168.2.227:9092,192.168.2.222:9092");
x.UseKafka("192.168.1.26:9092");
x.UseDashboard();
x.UseDiscovery(d =>
{


+ 2
- 2
samples/Sample.RabbitMQ.MySql/AppDbContext.cs View File

@@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.MySql
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//optionsBuilder.UseMySql("Server=localhost;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;");
optionsBuilder.UseMySql("Server=192.168.2.206;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;");
optionsBuilder.UseMySql("Server=localhost;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;");
//optionsBuilder.UseMySql("Server=192.168.2.206;Database=Sample.RabbitMQ.MySql;UserId=root;Password=123123;");
}
}
}

+ 1
- 1
samples/Sample.RabbitMQ.MySql/Sample.RabbitMQ.MySql.csproj View File

@@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0-rtm-10056" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />


+ 1
- 5
samples/Sample.RabbitMQ.MySql/Startup.cs View File

@@ -18,11 +18,7 @@ namespace Sample.RabbitMQ.MySql
services.AddCap(x =>
{
x.UseEntityFramework<AppDbContext>();
x.UseRabbitMQ(y => {
y.HostName = "192.168.2.206";
y.UserName = "admin";
y.Password = "123123";
});
x.UseRabbitMQ("localhost");
x.UseDashboard();
x.UseDiscovery(d =>
{


+ 1
- 1
samples/Sample.RabbitMQ.PostgreSql/AppDbContext.cs View File

@@ -10,7 +10,7 @@ namespace Sample.RabbitMQ.PostgreSql
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Server=localhost;Database=Sample.RabbitMQ.PostgreSql;UserId=postgre;Password=123123;");
optionsBuilder.UseNpgsql("Server=localhost;Database=Sample.RabbitMQ.PostgreSql;UserId=postgres;Password=123123;");
}
}
}

+ 3
- 7
samples/Sample.RabbitMQ.PostgreSql/Startup.cs View File

@@ -13,15 +13,11 @@ namespace Sample.RabbitMQ.PostgreSql
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<AppDbContext>();
services.AddCap(x =>
{
x.UseEntityFramework<AppDbContext>();
x.UseRabbitMQ(z =>
{
z.HostName = "192.168.2.206";
z.UserName = "admin";
z.Password = "123123";
});
x.UseRabbitMQ("localhost");
x.UseDashboard();
x.UseDiscovery(d =>
{
@@ -29,7 +25,7 @@ namespace Sample.RabbitMQ.PostgreSql
d.DiscoveryServerPort = 8500;
d.CurrentNodeHostName = "localhost";
d.CurrentNodePort = 5800;
d.NodeName = "CAP一号节点";
d.NodeName = "CAP 一号节点";
});
});
services.AddMvc();


+ 2
- 2
samples/Sample.RabbitMQ.SqlServer/AppDbContext.cs View File

@@ -10,8 +10,8 @@ namespace Sample.RabbitMQ.SqlServer

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=TestCap;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True");
// optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True");
//optionsBuilder.UseSqlServer("Server=192.168.2.206;Initial Catalog=TestCap;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True");
optionsBuilder.UseSqlServer("Server=DESKTOP-M9R8T31;Initial Catalog=Sample.Kafka.SqlServer;User Id=sa;Password=P@ssw0rd;MultipleActiveResultSets=True");
}
}
}

+ 2
- 15
samples/Sample.RabbitMQ.SqlServer/Program.cs View File

@@ -8,21 +8,7 @@ namespace Sample.RabbitMQ.SqlServer
{
public class Program
{

//var config = new ConfigurationBuilder()
// .AddCommandLine(args)
// .AddEnvironmentVariables("ASPNETCORE_")
// .Build();

//var host = new WebHostBuilder()
// .UseConfiguration(config)
// .UseKestrel()
// .UseContentRoot(Directory.GetCurrentDirectory())
// .UseIISIntegration()
// .UseStartup<Startup>()
// .Build();

//host.Run();
public static void Main(string[] args)
{
BuildWebHost(args).Run();
@@ -30,6 +16,7 @@ namespace Sample.RabbitMQ.SqlServer

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://*:5800")
.UseStartup<Startup>()
.Build();



+ 6
- 9
samples/Sample.RabbitMQ.SqlServer/Startup.cs View File

@@ -19,20 +19,17 @@ namespace Sample.RabbitMQ.SqlServer
services.AddCap(x =>
{
x.UseEntityFramework<AppDbContext>();
x.UseRabbitMQ(z =>
{
z.HostName = "192.168.2.206";
z.UserName = "admin";
z.Password = "123123";
});
x.UseDashboard(d => { d.StatsPollingInterval = 1000000; });
x.UseRabbitMQ("localhost");
x.UseDashboard();
x.UseDiscovery(d =>
{
d.DiscoveryServerHostName = "localhost";
d.DiscoveryServerPort = 8500;
d.CurrentNodeHostName = "localhost";

d.CurrentNodeHostName = "192.168.1.11";
d.CurrentNodePort = 5800;
d.NodeName = "CAP一号节点";
d.NodeName = "CAP Node Windows";
d.NodeId = 1;
});
});



+ 1
- 1
src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj View File

@@ -12,7 +12,7 @@
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.0" />
<PackageReference Include="MySqlConnector" Version="0.27.0" />
<PackageReference Include="MySqlConnector" Version="0.28.0" />
</ItemGroup>

<ItemGroup>


+ 4
- 4
test/DotNetCore.CAP.MySql.Test/DotNetCore.CAP.MySql.Test.csproj View File

@@ -16,12 +16,12 @@
<ItemGroup>
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="MySqlConnector" Version="0.26.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="MySqlConnector" Version="0.28.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Moq" Version="4.7.137" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />


+ 2
- 2
test/DotNetCore.CAP.PostgreSql.Test/DotNetCore.CAP.PostgreSql.Test.csproj View File

@@ -10,8 +10,8 @@
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="Npgsql" Version="3.2.5" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
</ItemGroup>

<ItemGroup>


+ 3
- 3
test/DotNetCore.CAP.SqlServer.Test/DotNetCore.CAP.SqlServer.Test.csproj View File

@@ -14,11 +14,11 @@
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Moq" Version="4.7.137" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />


+ 3
- 3
test/DotNetCore.CAP.Test/DotNetCore.CAP.Test.csproj View File

@@ -10,11 +10,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="System.Data.Common" Version="4.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Moq" Version="4.7.137" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
</ItemGroup>



Loading…
Cancel
Save