Browse Source

update samples.

master
Savorboard 6 years ago
parent
commit
b136e21d44
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      samples/Sample.RabbitMQ.MySql/AppDbContext.cs
  2. +3
    -2
      samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs

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

@@ -11,7 +11,7 @@ namespace Sample.RabbitMQ.MySql

public class AppDbContext : DbContext
{
public const string ConnectionString = "Server=192.168.10.110;Database=testcap;UserId=root;Password=123123;";
public const string ConnectionString = "Server=localhost;Database=testcap;UserId=root;Password=123123;";

public DbSet<Person> Persons { get; set; }



+ 3
- 2
samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs View File

@@ -1,5 +1,6 @@
using System;
using System.Data;
using System.Threading.Tasks;
using Dapper;
using DotNetCore.CAP;
using Microsoft.AspNetCore.Mvc;
@@ -18,9 +19,9 @@ namespace Sample.RabbitMQ.MySql.Controllers
}

[Route("~/without/transaction")]
public IActionResult WithoutTransaction()
public async Task<IActionResult> WithoutTransaction()
{
_capBus.Publish("sample.rabbitmq.mysql", DateTime.Now);
await _capBus.PublishAsync("sample.rabbitmq.mysql", DateTime.Now);

return Ok();
}


Loading…
Cancel
Save