Skip to content

Commit b896333

Browse files
authored
Merge pull request #49 from gijswijs/InMemoryDb-transactions-patch
Add configuration to in memory database in Startup.cs
2 parents 814981b + 3809d4e commit b896333

File tree

1 file changed

+3
-1
lines changed
  • test/AbpCompanyName.AbpProjectName.Web.Tests

1 file changed

+3
-1
lines changed

test/AbpCompanyName.AbpProjectName.Web.Tests/Startup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Microsoft.EntityFrameworkCore;
1212
using Microsoft.Extensions.DependencyInjection;
1313
using Microsoft.Extensions.Logging;
14+
using Microsoft.EntityFrameworkCore.Diagnostics;
1415

1516
namespace AbpCompanyName.AbpProjectName.Web.Tests
1617
{
@@ -51,7 +52,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
5152
private void UseInMemoryDb(IServiceProvider serviceProvider)
5253
{
5354
var builder = new DbContextOptionsBuilder<AbpProjectNameDbContext>();
54-
builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseInternalServiceProvider(serviceProvider);
55+
builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseInternalServiceProvider(serviceProvider)
56+
.ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning));
5557
var options = builder.Options;
5658

5759
var iocManager = serviceProvider.GetRequiredService<IIocManager>();

0 commit comments

Comments
 (0)