Parcourir la source

update samples

master
Savorboard il y a 6 ans
Parent
révision
45bd5ed2d1
3 fichiers modifiés avec 1 ajouts et 4 suppressions
  1. +0
    -2
      samples/Sample.Kafka.MySql/Controllers/ValuesController.cs
  2. +1
    -1
      samples/Sample.RabbitMQ.MySql/AppDbContext.cs
  3. +0
    -1
      samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs

+ 0
- 2
samples/Sample.Kafka.MySql/Controllers/ValuesController.cs Voir le fichier

@@ -1,7 +1,6 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Transactions;
using Dapper;
using DotNetCore.CAP;
using Microsoft.AspNetCore.Mvc;
@@ -30,7 +29,6 @@ namespace Sample.Kafka.MySql.Controllers
[Route("~/adonet/transaction")]
public IActionResult AdonetWithTransaction()
{
//NOTE: Add `IgnoreCommandTransaction=true;` to your connection string, see https://github.com/mysql-net/MySqlConnector/issues/474
using (var connection = new SqlConnection(Startup.ConnectionString))
{
using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false))


+ 1
- 1
samples/Sample.RabbitMQ.MySql/AppDbContext.cs Voir le fichier

@@ -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;IgnoreCommandTransaction=true;";
public const string ConnectionString = "Server=192.168.10.110;Database=testcap;UserId=root;Password=123123;";

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



+ 0
- 1
samples/Sample.RabbitMQ.MySql/Controllers/ValuesController.cs Voir le fichier

@@ -28,7 +28,6 @@ namespace Sample.RabbitMQ.MySql.Controllers
[Route("~/adonet/transaction")]
public IActionResult AdonetWithTransaction()
{
//NOTE: Add `IgnoreCommandTransaction=true;` to your connection string, see https://github.com/mysql-net/MySqlConnector/issues/474
using (var connection = new MySqlConnection(AppDbContext.ConnectionString))
{
using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false))


Chargement…
Annuler
Enregistrer