* Add UmbracoEFCore project * Add EFCore composer * Add Locking Mechanisms * Add scope interfaces * Add excecute scalar extension method * fix up query in locking mechanism * Add scoping * Add scoping * Add test DbContext classes * add locking test of EFCore * Creat ScopedFileSystemsTests * Add EFCoreScopeInfrastructureScopeLockTests * Add EFCoreScopeInfrastructureScopeTests * Add EFCoreScopeNotificationsTest.cs * Add EFCoreScopeTest.cs * Remake AddUmbracoEFCoreContext to use connection string * Remove unused code from extension method * Reference EFCore reference to Cms.csproj * Remove unused parameter * Dont have default implementation, breaking change instead * Add compatability suppression file * Updated EFCore packages * Use timespan for timeout * Allow overriding default EF Core actions * Option lifetime needs to be singleton * Use given timeout in database call * dont use timespan.zero, use null instead * Use variable timeout * Update test to use locking mechanism * Remove unneccesary duplicate code * Change to catch proper exception number --------- Co-authored-by: Zeegaan <nge@umbraco.dk> Co-authored-by: Bjarke Berg <mail@bergmania.dk>
32 lines
884 B
C#
32 lines
884 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.DbContext;
|
|
|
|
public class TestUmbracoDbContext : Microsoft.EntityFrameworkCore.DbContext
|
|
{
|
|
public TestUmbracoDbContext(DbContextOptions<TestUmbracoDbContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
internal virtual DbSet<UmbracoLock> UmbracoLocks { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<UmbracoLock>(entity =>
|
|
{
|
|
entity.ToTable("umbracoLock");
|
|
|
|
entity.Property(e => e.Id)
|
|
.ValueGeneratedNever()
|
|
.HasColumnName("id");
|
|
|
|
entity.Property(e => e.Name)
|
|
.HasMaxLength(64)
|
|
.HasColumnName("name");
|
|
|
|
entity.Property(e => e.Value).HasColumnName("value");
|
|
});
|
|
}
|
|
}
|