Browse Source
`AlwaysDisableUnitOfWorkTransaction` in template projects.
pull/15508/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
5 additions and
0 deletions
-
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
-
templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
|
|
@ -7,6 +7,7 @@ using Volo.Abp; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore.Sqlite; |
|
|
using Volo.Abp.EntityFrameworkCore.Sqlite; |
|
|
using Volo.Abp.Modularity; |
|
|
using Volo.Abp.Modularity; |
|
|
|
|
|
using Volo.Abp.Uow; |
|
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
|
|
|
|
|
|
@ -21,6 +22,7 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule |
|
|
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
{ |
|
|
{ |
|
|
|
|
|
context.Services.AddAlwaysDisableUnitOfWorkTransaction(); |
|
|
ConfigureInMemorySqlite(context.Services); |
|
|
ConfigureInMemorySqlite(context.Services); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Storage; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore.Sqlite; |
|
|
using Volo.Abp.EntityFrameworkCore.Sqlite; |
|
|
using Volo.Abp.Modularity; |
|
|
using Volo.Abp.Modularity; |
|
|
|
|
|
using Volo.Abp.Uow; |
|
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
|
|
|
|
|
|
@ -17,6 +18,8 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule |
|
|
{ |
|
|
{ |
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
{ |
|
|
{ |
|
|
|
|
|
context.Services.AddAlwaysDisableUnitOfWorkTransaction(); |
|
|
|
|
|
|
|
|
var sqliteConnection = CreateDatabaseAndGetConnection(); |
|
|
var sqliteConnection = CreateDatabaseAndGetConnection(); |
|
|
|
|
|
|
|
|
Configure<AbpDbContextOptions>(options => |
|
|
Configure<AbpDbContextOptions>(options => |
|
|
|