Browse Source

Update UnitOfWorkDbContextProvider.cs

pull/16951/head
maliming 3 years ago
parent
commit
4b155840b3
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 20
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs

20
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Uow/EntityFrameworkCore/UnitOfWorkDbContextProvider.cs

@ -18,7 +18,7 @@ namespace Volo.Abp.Uow.EntityFrameworkCore;
public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbContext>
where TDbContext : IEfCoreDbContext
{
private const string TransactionsNotSupportedErrorMessage = "Current database does not support transactions. Your database may remain in an inconsistent state in an error case.";
private const string TransactionsNotSupportedWarningMessage = "Current database does not support transactions. Your database may remain in an inconsistent state in an error case.";
public ILogger<UnitOfWorkDbContextProvider<TDbContext>> Logger { get; set; }
@ -189,8 +189,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}
@ -227,8 +226,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}
@ -245,8 +243,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}
@ -284,8 +281,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}
@ -327,8 +323,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}
@ -345,8 +340,7 @@ public class UnitOfWorkDbContextProvider<TDbContext> : IDbContextProvider<TDbCon
}
catch (Exception e) when (e is InvalidOperationException || e is NotSupportedException)
{
Logger.LogError(TransactionsNotSupportedErrorMessage);
Logger.LogException(e);
Logger.LogWarning(TransactionsNotSupportedWarningMessage);
return dbContext;
}

Loading…
Cancel
Save