diff --git a/src/StronglyTypedIds/Templates/Guid/Guid_EfCoreValueConverter.cs b/src/StronglyTypedIds/Templates/Guid/Guid_EfCoreValueConverter.cs index 18e4d5d61..518e827a3 100644 --- a/src/StronglyTypedIds/Templates/Guid/Guid_EfCoreValueConverter.cs +++ b/src/StronglyTypedIds/Templates/Guid/Guid_EfCoreValueConverter.cs @@ -8,4 +8,14 @@ public EfCoreValueConverter(Microsoft.EntityFrameworkCore.Storage.ValueConversio value => new TESTID(value), mappingHints ) { } + } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override TESTID Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return TESTID.New(); + } } \ No newline at end of file diff --git a/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs b/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs index 2245e6cf1..a17fa3169 100644 --- a/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs +++ b/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs @@ -8,4 +8,16 @@ public EfCoreValueConverter(Microsoft.EntityFrameworkCore.Storage.ValueConversio value => new TESTID(value), mappingHints ) { } + } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override TESTID Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new TESTID(_id); + } } \ No newline at end of file diff --git a/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs b/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs index 96422f377..eb610437f 100644 --- a/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs +++ b/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs @@ -8,4 +8,16 @@ public EfCoreValueConverter(Microsoft.EntityFrameworkCore.Storage.ValueConversio value => new TESTID(value), mappingHints ) { } + } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override TESTID Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new TESTID(_id); + } } \ No newline at end of file diff --git a/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs b/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs index b2f70dbcb..03563a147 100644 --- a/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs +++ b/test/StronglyTypedIds.IntegrationTests/LongIdTests.cs @@ -200,6 +200,32 @@ public void WhenEfCoreValueConverterUsesValueConverter() Assert.Equal(original.Id, retrieved.Id); } } + + [Fact] + public void WhenEfCoreValueGenerationUsesValueGenerator() + { + var connection = new SqliteConnection("DataSource=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + var original = new GenerationTestEntity(); + using (var context = new TestDbContext(options)) + { + context.Database.EnsureCreated(); + context.GenerationEntities.Add(original); + context.SaveChanges(); + } + + using (var context = new TestDbContext(options)) + { + var all = context.GenerationEntities.ToList(); + var retrieved = Assert.Single(all); + Assert.Equal(1, retrieved.Id.Value); + } + } [Fact] public async Task WhenDapperValueConverterUsesValueConverter() @@ -322,6 +348,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) public class TestDbContext : DbContext { public DbSet Entities { get; set; } + public DbSet GenerationEntities { get; set; } public TestDbContext(DbContextOptions options) : base(options) { @@ -337,6 +364,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConversion(new EfCoreLongId.EfCoreValueConverter()) .ValueGeneratedNever(); }); + modelBuilder + .Entity(builder => + { + builder + .Property(x => x.Id) + .HasConversion(new EfCoreLongId.EfCoreValueConverter()) + .HasValueGenerator() + .ValueGeneratedOnAdd(); + }); } } @@ -345,6 +381,11 @@ public class TestEntity public EfCoreLongId Id { get; set; } } + public class GenerationTestEntity + { + public EfCoreLongId Id { get; set; } + } + public class EntityWithNullableId { public NewtonsoftJsonLongId? Id { get; set; } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=0.verified.txt index 194e7542b..f07131e41 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=0.verified.txt @@ -46,5 +46,15 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=2.verified.txt index 6e1dbb941..3c76f08cf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=2.verified.txt @@ -46,5 +46,15 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=4.verified.txt index 292c2428f..0db4d4096 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=4.verified.txt @@ -47,5 +47,15 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=6.verified.txt index b055114b5..679cd3178 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Guid_implementations=6.verified.txt @@ -47,5 +47,15 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=0.verified.txt index 04d8d094c..fabe80883 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=0.verified.txt @@ -45,5 +45,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=2.verified.txt index cd56bfdb8..c9c8b7238 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=2.verified.txt @@ -45,5 +45,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=4.verified.txt index 82c961fea..de3da0919 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=4.verified.txt @@ -46,5 +46,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=6.verified.txt index 7c1beae5a..4386935b1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Int_implementations=6.verified.txt @@ -46,5 +46,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=0.verified.txt index 241ac4315..0f8ca27cc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=0.verified.txt @@ -45,5 +45,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=2.verified.txt index 86a343456..186eafcad 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=2.verified.txt @@ -45,5 +45,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=4.verified.txt index e6dfea3e5..68d4ac2b1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=4.verified.txt @@ -46,5 +46,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=6.verified.txt index b8576cdcc..9e814a56e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=16_backingType=Long_implementations=6.verified.txt @@ -46,5 +46,17 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=0.verified.txt index 211608ccc..e6ffa4445 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=2.verified.txt index 0e5d5ab0d..0c9135b1a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=4.verified.txt index dd03a2d8d..8605ca5fe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=6.verified.txt index 50a48d3d2..4feba2c5f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=0.verified.txt index 4685ac834..42b8a8ec0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=2.verified.txt index d4a4846ab..8da182aa2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=4.verified.txt index 19f743ef4..cdbc51c9c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=6.verified.txt index 000b4ffbb..c023d0649 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=0.verified.txt index 0e9376897..c073c7650 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=2.verified.txt index 10bbe32e4..aa760cf96 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=4.verified.txt index 9fc37bec1..3552f7914 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=6.verified.txt index c4e157038..fe3734818 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=0.verified.txt index 79c08cb83..906d4b7b4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=2.verified.txt index 7007349de..fddb37d9d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=4.verified.txt index ac02c972c..9df8d5fdf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=6.verified.txt index 44e4aeb43..699cfc21a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=0.verified.txt index c538a6642..0cde9dd78 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=2.verified.txt index 2ce277d29..0ed369752 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=4.verified.txt index 0499f4904..32ee14974 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=6.verified.txt index 785bbf7c8..4850417a0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=0.verified.txt index 7f919ca6d..6cc85f4a0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=2.verified.txt index 67c43f9e7..10f0a5011 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=4.verified.txt index d3cb95dff..b710408ed 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=6.verified.txt index bc81e6e5a..4d6948dc2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=20_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=0.verified.txt index 0de87fb62..160c6b487 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=2.verified.txt index 377decb04..9ace30e53 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=4.verified.txt index 21d487148..15bfc2887 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=6.verified.txt index 039a56446..65e056cdc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=0.verified.txt index 154e322c8..714eec551 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=2.verified.txt index aec1376ca..503019128 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=4.verified.txt index 2d025e868..762b6a0fc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=6.verified.txt index d66ad02a2..4b9dc0abc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=0.verified.txt index f630b8fdc..5e13914fc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=2.verified.txt index 63b322c4d..ee4741b11 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=4.verified.txt index 27d7fab62..b26a06e49 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=6.verified.txt index 6c60c9a4e..05b75a554 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=22_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=0.verified.txt index cec9f93ef..5d7608780 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=2.verified.txt index 3c7808a44..0711536fe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=4.verified.txt index d6a13365a..ae8e3c9dd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=6.verified.txt index aa05d4ee7..28a4815c7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=0.verified.txt index 6fb2cde57..0262ca11b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=2.verified.txt index 1bf5a3d86..efdcb73cf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=4.verified.txt index 5e387eb65..a73def099 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=6.verified.txt index 12c450152..35e009967 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=0.verified.txt index 7c468580a..bbdc8a9f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=2.verified.txt index 9d632a09b..ad11301ec 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=4.verified.txt index e266a957e..63af35ee0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=6.verified.txt index bc610e4fb..0d5ebf549 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=24_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=0.verified.txt index 34a3d770d..f45b1f450 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=2.verified.txt index d40ed90d0..fdb22f031 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=4.verified.txt index 0ccde754e..6f809e733 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=6.verified.txt index 02b6e655d..8366fbabf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=0.verified.txt index 232ec5018..fb3239ddb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=2.verified.txt index bdd55ec7f..2cfd56295 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=4.verified.txt index d7f636f5a..632555611 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=6.verified.txt index d168f1af4..5660c702a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=0.verified.txt index 8a67cb348..db64761d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=2.verified.txt index f8ca379d4..afbd67a55 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=4.verified.txt index 797793d45..faa560751 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=6.verified.txt index 2f5cc78e7..56e6afe96 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=26_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=0.verified.txt index 0ff6594db..4b6806bbd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=2.verified.txt index c97e7fbea..ac3a426a9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=4.verified.txt index c17d1f458..ec171c3b1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=6.verified.txt index c26af6cd9..b3084cd9a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=0.verified.txt index 8e590dc5e..94c4b04ba 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=2.verified.txt index 7822d351d..0ccf262a8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=4.verified.txt index 7dedd98b2..ef2891303 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=6.verified.txt index ae9e502f9..98487f8e7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=0.verified.txt index 30f88d9e3..90fa8bdeb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=2.verified.txt index 847ee0353..3440e588b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=4.verified.txt index 15adbe86f..442cfea3e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=6.verified.txt index e6b03e1a8..7be9aca49 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=28_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=0.verified.txt index 188de8470..dc3929cb6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=0.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=2.verified.txt index 8b109d9ff..435f7c839 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=2.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=4.verified.txt index d90c01911..b69925df8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=4.verified.txt @@ -50,6 +50,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=6.verified.txt index 9594e104d..1f69e7f67 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Guid_implementations=6.verified.txt @@ -50,6 +50,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=0.verified.txt index 3bc5c3215..e0bf37abc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=0.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=2.verified.txt index b968b9847..77b375a96 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=2.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=4.verified.txt index 19f277cfb..364078c6f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=4.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=6.verified.txt index 0f4c59fed..cfb77eadd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Int_implementations=6.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=0.verified.txt index fd0e852d8..a85629341 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=0.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=2.verified.txt index f13ee5ce6..5d0e852d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=2.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=4.verified.txt index 139126777..7c5e9e6d2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=4.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=6.verified.txt index 2d4cefe80..e98fab7b0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=30_backingType=Long_implementations=6.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=0.verified.txt index 03dbb3c9f..4d83946e7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=2.verified.txt index 92da89a22..534c7d484 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=4.verified.txt index c40b04700..d19ae5c24 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=6.verified.txt index c093fdb66..92af2f9a7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=0.verified.txt index 4b822535a..c90e895b3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=2.verified.txt index aaf95ace8..76f5477dd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=4.verified.txt index 19056a123..331bf8f85 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=6.verified.txt index 4cd595320..a5fe2c326 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=0.verified.txt index 70fe9a37c..70b0a4100 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=2.verified.txt index f956875e8..7f24a9cd2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=4.verified.txt index 369e4c9be..37fc99904 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=6.verified.txt index 50e22ebed..e9e7e3f3c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=48_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=0.verified.txt index 74b3f985d..8f75c8339 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=2.verified.txt index bef56bd9d..8c88b56d2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=4.verified.txt index 14f823999..0ecc54c35 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=6.verified.txt index 02cc61e70..aaa214388 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=0.verified.txt index 830548f68..8794757d3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=2.verified.txt index 201c1d3a5..782e41d20 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=4.verified.txt index 1e9fc8a8e..2cfaaa36b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=6.verified.txt index af7322448..d4254aef5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=0.verified.txt index c29cede8f..667607d73 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=2.verified.txt index d1c68d776..d3ce07313 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=4.verified.txt index 52391548d..574a7f594 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=6.verified.txt index 9aa13e282..ab640efad 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=0.verified.txt index 14287be4d..ca75f723c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=2.verified.txt index b5725c055..4358bf07e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=4.verified.txt index a805f7b7b..50d12c812 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=6.verified.txt index ede5c8b7f..b93ece72d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=0.verified.txt index 4f180eb82..6ff90c349 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=2.verified.txt index 4888525b3..665564f97 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=4.verified.txt index 8a3a54609..532c806e1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=6.verified.txt index 130096ed3..6e0d71de3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=0.verified.txt index f339a4a25..562213f44 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=2.verified.txt index 1cb5fdb93..ffe31a04b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=4.verified.txt index 41c24879b..78fd0eebe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=6.verified.txt index 287d01cde..80698bd68 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=0.verified.txt index a80d8ce2a..e85097632 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=2.verified.txt index 6be81c54d..c0e74b38b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=4.verified.txt index c678364fd..f9ac3daa8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=6.verified.txt index 5acb780e5..da86fedd1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=0.verified.txt index 52d17d86e..cf737700c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=2.verified.txt index 1e4487da4..84b8301e1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=4.verified.txt index bf3455804..0e1eba0da 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=6.verified.txt index 61f9826c6..ea4a5f2d3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=0.verified.txt index 42bfe9f6c..107085193 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=2.verified.txt index d6c26948e..54c6be448 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=4.verified.txt index 069545233..b16962ea8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=6.verified.txt index d9578fa9d..c82c1e7b0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=0.verified.txt index 6e06a9bce..03c27b0a2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=2.verified.txt index 6525ea8b1..8daf5c388 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=4.verified.txt index 667ef258f..b18ed02b5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=6.verified.txt index 94f17d951..8b5199295 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=0.verified.txt index 09eeb88eb..290d9442c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=2.verified.txt index 39051df41..5ee08800c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=4.verified.txt index c7947cce6..bed614af5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=6.verified.txt index cdcd225d3..df3f152be 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=0.verified.txt index 8ed2eaf78..717313084 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=2.verified.txt index f6c88de02..bcd887adf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=4.verified.txt index 29253a73a..41f7d2623 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=6.verified.txt index 2780b7afa..ea63bde82 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=0.verified.txt index 5c7a44b39..7ebc71136 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=2.verified.txt index b1fc6fe23..1f668e8cd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=4.verified.txt index 93fb7f31f..38dc76f94 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=6.verified.txt index 2d15bbe19..037e34bef 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=0.verified.txt index 9f30e3c8a..01b155caa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=2.verified.txt index 1e251ae8d..316893167 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=4.verified.txt index 90f3ae91b..bbce8ddc1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=6.verified.txt index 9f70b1d05..91f7d9266 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=0.verified.txt index e31445d23..d11db0489 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=2.verified.txt index 4e087c276..6b6f42ebe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=4.verified.txt index 5132b77e5..171a29e42 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=6.verified.txt index 9680ddd53..67ca07ad3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=0.verified.txt index 3b7408bb7..9ddf536d9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=0.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=2.verified.txt index 73c179774..a392a2572 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=2.verified.txt @@ -48,6 +48,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=4.verified.txt index cb93e2a05..58db5af7a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=4.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=6.verified.txt index 1f0ef8bd0..5b8da8cb3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Guid_implementations=6.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=0.verified.txt index bf50776b5..881e37b48 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=2.verified.txt index c4b276926..47004d19c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=4.verified.txt index 9bb9dc032..22f7e10cc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=6.verified.txt index 874fde737..678d29fd5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=0.verified.txt index 4a1be347a..d0c6ba0ac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=0.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=2.verified.txt index bb4e5ceda..0ba88b074 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=2.verified.txt @@ -47,6 +47,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=4.verified.txt index ff82b6f98..6fed64460 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=4.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=6.verified.txt index 66cbcd9ab..dd2974370 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Long_implementations=6.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=0.verified.txt index 51a3cbe77..a4644a57e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=0.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=2.verified.txt index 1e4936444..b52528d24 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=2.verified.txt @@ -49,6 +49,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=4.verified.txt index 2df62346d..03ec83f04 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=4.verified.txt @@ -50,6 +50,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=6.verified.txt index 69224101c..84a6ae596 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Guid_implementations=6.verified.txt @@ -50,6 +50,16 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=0.verified.txt index a2f7eed1b..57833418a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=0.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=2.verified.txt index 9e659a8c6..da90e1851 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=2.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=4.verified.txt index 9c5c16f05..036d895e0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=4.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=6.verified.txt index 8eac88355..9baed7e8a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=6.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=0.verified.txt index 262c67704..fbfa642a4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=0.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=2.verified.txt index 6a7062db6..7b46910c6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=2.verified.txt @@ -48,6 +48,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=4.verified.txt index c89552402..a6e4ed71f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=4.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=6.verified.txt index 888756220..514772b0f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Long_implementations=6.verified.txt @@ -49,6 +49,18 @@ namespace Some.Namespace mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=0.verified.txt index 508208c37..ef7ede4d0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=0.verified.txt @@ -44,4 +44,14 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=2.verified.txt index bd295d6c1..e0c941562 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=2.verified.txt @@ -44,4 +44,14 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=4.verified.txt index 218054f51..ff64a2a74 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=4.verified.txt @@ -45,4 +45,14 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=6.verified.txt index 2c39146fd..80d952831 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Guid_implementations=6.verified.txt @@ -45,4 +45,14 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int.verified.txt index a2b380f84..3ca4122a8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int.verified.txt @@ -41,4 +41,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=0.verified.txt index d3e50467b..566eb709d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=0.verified.txt @@ -43,4 +43,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=2.verified.txt index 57b00caf5..45af1688a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=2.verified.txt @@ -43,4 +43,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=4.verified.txt index 3ad892329..75ed8f586 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=4.verified.txt @@ -44,4 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=6.verified.txt index d6d3caa9d..6097425f6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=6.verified.txt @@ -44,4 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long.verified.txt index 2caf566c2..572f4b195 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long.verified.txt @@ -41,4 +41,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=0.verified.txt index cb5754863..744ddbaac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=0.verified.txt @@ -43,4 +43,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=2.verified.txt index 57a90b071..a1383dcf4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=2.verified.txt @@ -43,4 +43,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=4.verified.txt index a745c3f85..d66d3c054 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=4.verified.txt @@ -44,4 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=6.verified.txt index 69bd91feb..8c1574ced 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=6.verified.txt @@ -44,4 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } } diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=0.verified.txt index a5b390ae9..bd8c3f01a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=2.verified.txt index e573e26b8..f810c49f1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=4.verified.txt index 47e26f681..66774fec7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=6.verified.txt index 869f212bd..bcf131bbd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int.verified.txt index 104f4e705..ac22846d3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=0.verified.txt index 6016a2f1b..d02834e78 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=2.verified.txt index f2562c2ed..62798e9dc 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=4.verified.txt index 75f28ad18..22aec1220 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=6.verified.txt index e14dde339..f2ce33a84 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long.verified.txt index b7d0c6563..a264855ac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=0.verified.txt index 8a123daa5..cf03d0c20 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=2.verified.txt index 66632ba08..4616475f0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=4.verified.txt index 76acb43d2..ce90f863e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=6.verified.txt index ef65e5b9d..eb7c4c621 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=0.verified.txt index f86ca50f7..f6d7a83da 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=2.verified.txt index 67cee8d3f..c654a9825 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=4.verified.txt index 66d5c3199..51bc57e82 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=6.verified.txt index 855f85d33..8801ed3b4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int.verified.txt index 34ae45ac7..9175d7886 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=0.verified.txt index 4f9bb59c7..39b3f2fc7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=2.verified.txt index cf0ea31f5..b4936069c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=4.verified.txt index b657266e5..11a9c55fa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=6.verified.txt index 8c5cbf33c..da65fd663 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long.verified.txt index b431fa996..2f16a3ad5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=0.verified.txt index 6718cc52c..35a054575 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=2.verified.txt index ff4ab817f..3807db3bb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=4.verified.txt index 6ca5cdcb4..e1feb397a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=6.verified.txt index 62179e110..844cb6ee9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=0.verified.txt index 5e1569b6b..2ad8ed6e2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=2.verified.txt index 90e0deecc..29e986f80 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=4.verified.txt index 3757efcdd..7c054569c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=6.verified.txt index e397af5cf..be57e32ca 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int.verified.txt index 1f2063b71..7e7cce0c7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=0.verified.txt index 5671bb03a..4f03e7c85 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=2.verified.txt index 070ac005d..a92798427 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=4.verified.txt index d1700fa01..aea1dd0d1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=6.verified.txt index 9c2b9ddaf..c684edb16 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long.verified.txt index 454a95c35..a92c9c434 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=0.verified.txt index 74e104457..a7823ab1f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=2.verified.txt index 6c9ac56cd..58fa9fe89 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=4.verified.txt index db563c670..394661289 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=6.verified.txt index 3492a3860..943575dc4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=0.verified.txt index 572994e92..0b2e6886b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=2.verified.txt index e9deef96b..5a63cfe02 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=4.verified.txt index aebeabd1b..7c5b4527f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=6.verified.txt index 88e82cd4c..0ed672bf7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int.verified.txt index 07ad615c1..c99d4fa38 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=0.verified.txt index 9d057d1d5..663e06b7b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=2.verified.txt index 1f67e3e4b..2647688f2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=4.verified.txt index fed6ab8b0..4d165bd0b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=6.verified.txt index 54704e2a9..b6d83bd02 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long.verified.txt index 8b845292b..73a2c785d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=0.verified.txt index c9e25364d..28c3f1b74 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=2.verified.txt index b42ebab87..44f5101bb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=4.verified.txt index f340a7c78..937d42123 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=6.verified.txt index d9fcaa98a..7e5f9e053 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=0.verified.txt index c1552f596..7c328d66c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=2.verified.txt index 764750b7a..be6c11137 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=4.verified.txt index ef0ee8b70..aaacfbb1d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=6.verified.txt index 15719bcb6..42af35504 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int.verified.txt index d014cc176..15e4f426b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=0.verified.txt index 3edba7f5e..5a4c0a875 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=2.verified.txt index 4fa0b420d..8d174403e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=4.verified.txt index e1c40915d..ca8489b18 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=6.verified.txt index c261528c6..f4f3cfd04 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long.verified.txt index 36d28ac01..6e3f90cec 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=0.verified.txt index 16cf6d87e..eebd881e4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=2.verified.txt index 6f5ac7b23..642f67b0d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=4.verified.txt index 4bbcc932a..19c3d9d47 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=6.verified.txt index f3eb336e3..867c3e77e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=0.verified.txt index ffa130f3d..042b821da 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=2.verified.txt index 84879e5ed..6e36a8b66 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=4.verified.txt index 28f65ef8c..7ec5473be 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=6.verified.txt index 19344a1c3..fc3d4002d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int.verified.txt index 1e66ae923..18ba938a8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=0.verified.txt index f1a2afbf1..54d66b49b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=2.verified.txt index 18c5e7a5d..c673fc234 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=4.verified.txt index d7f221f75..1a01f7bc7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=6.verified.txt index 5674055a8..dfeca208b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long.verified.txt index 491f063c8..9cd798aa4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=0.verified.txt index fff8e297c..e3a0453ac 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=2.verified.txt index 4d6f17df0..0798aa3ff 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=4.verified.txt index c5f5fbcad..7684d445b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=6.verified.txt index 036787a5a..fa963097a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=0.verified.txt index 957c09cb5..14707626e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=2.verified.txt index 22978188c..eb17b70d5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=4.verified.txt index aad522deb..6dd6ad565 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=6.verified.txt index 80bbfe1a5..625725317 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int.verified.txt index 79a268679..a655cb303 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=0.verified.txt index da8e84ba4..63f0d9543 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=2.verified.txt index a89f12ed3..00ea575a8 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=4.verified.txt index 7f20719fe..ddcb23e01 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=6.verified.txt index 255308e13..8d8af9ef9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long.verified.txt index 584c09c2f..c741350c7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=0.verified.txt index 22a36bb65..812413321 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=2.verified.txt index 3821a625f..fcea4ac4e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=4.verified.txt index 878302f71..2fcef8951 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=6.verified.txt index d899d420a..2d5562390 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=0.verified.txt index d7f316217..0168f8ae1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=0.verified.txt @@ -44,6 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=2.verified.txt index 298bcbcc8..f7e7fe3b9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=2.verified.txt @@ -44,6 +44,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=4.verified.txt index 812a1b5f4..e468489b4 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=4.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=6.verified.txt index 2ab13c905..66687dab5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Guid_implementations=6.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=0.verified.txt index a5f5102e4..12c0f145f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=0.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=2.verified.txt index d9d59241a..c45158457 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=2.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=4.verified.txt index 4a3a7fc71..0e807d6c5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=4.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=6.verified.txt index aecca7dd5..66a340ceb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=6.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long.verified.txt index a4e07c250..c573110c2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long.verified.txt @@ -41,6 +41,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=0.verified.txt index e4f6e79db..ebf749044 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=0.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=2.verified.txt index 094e8c23a..9c2f6d6a7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=2.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=4.verified.txt index 42f4d0210..f17c512ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=4.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=6.verified.txt index 1f0d97b99..f74fb4d1c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=6.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=0.verified.txt index 73747b40e..d5fb2b23a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=2.verified.txt index 65cc2b302..564d659ec 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=4.verified.txt index d6de41627..fb3767baf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=6.verified.txt index cc5f8ebe1..09f068653 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int.verified.txt index 3321eb092..22c109e4c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=0.verified.txt index 327e8c897..d992ce5eb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=2.verified.txt index 0bd6478f4..f607f400d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=4.verified.txt index 1113add5e..dc6533194 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=6.verified.txt index 277861014..f414d2247 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long.verified.txt index 0e468883f..c1cb6047b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=0.verified.txt index c2a005a0a..f32450fa5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=2.verified.txt index c27caa895..c51734bb6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=4.verified.txt index 249cfaa30..b6c7a3898 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=6.verified.txt index a6ee535d0..c72505367 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=0.verified.txt index a22b1513b..44f46ddc3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=2.verified.txt index 5fae89961..f653740ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=4.verified.txt index 809e649a4..a00c61756 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=6.verified.txt index 541e7f9f5..5de2dee6b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int.verified.txt index e4a1006a2..e4f440951 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=0.verified.txt index cc21919b7..df66b2403 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=2.verified.txt index 067afdeaf..cff9de824 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=4.verified.txt index 977ab2987..e6e0d4f2b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=6.verified.txt index 7e54c92f3..c608cf5c2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long.verified.txt index a41ebcae0..3a22c90e6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=0.verified.txt index c46d8b99c..f5a76d0f5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=2.verified.txt index 44d62b358..f7047407d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=4.verified.txt index 8ea7a51aa..a70014d98 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=6.verified.txt index 2d1d13de7..d81a79456 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=0.verified.txt index bd4ae8b8e..1ddc15a4b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=2.verified.txt index 2359feffa..cddf080ea 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=4.verified.txt index 468a3abbf..97ecaf9d6 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=6.verified.txt index 603d6c184..f34bde4bb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int.verified.txt index 986175d61..839e9602c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=0.verified.txt index ded8f2ab7..de3f24162 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=2.verified.txt index 05611cab9..4b77f7f2e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=4.verified.txt index 753376c71..049744e37 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=6.verified.txt index ba470f0ae..08493c10f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long.verified.txt index ac1b8ae9f..8b0d8bbfd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=0.verified.txt index a8f0ac31d..b237eba54 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=2.verified.txt index bfda82ce1..05b992daa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=4.verified.txt index b5fcd80eb..2c0074bbf 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=6.verified.txt index 983cd47f5..cd973154b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=0.verified.txt index c7c6026fa..74b1fecf3 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=0.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=2.verified.txt index 83e7701cf..ce4cdee0d 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=2.verified.txt @@ -45,6 +45,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=4.verified.txt index 25a5bdd7f..db40ab86b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=4.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=6.verified.txt index 2f3fc1848..0673a7469 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Guid_implementations=6.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int.verified.txt index 6f62e3ac7..4bd1a235f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=0.verified.txt index c57f81435..371c5691f 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=2.verified.txt index d0646dc1f..47740b084 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=4.verified.txt index 37da18f5d..91b5d11ce 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=6.verified.txt index 5cc2aa633..ff6f0d53a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long.verified.txt index 68ad79993..f33906a87 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long.verified.txt @@ -42,6 +42,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=0.verified.txt index fee9af854..994124ad0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=0.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=2.verified.txt index bcd1d22f5..37873a027 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=2.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=4.verified.txt index f83fe861f..53b83db23 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=4.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=6.verified.txt index ae9b13330..3cfc508a1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=6.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=0.verified.txt index 32c0c0bf3..ca164bd96 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=2.verified.txt index 421db02d3..7efa97f8b 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=4.verified.txt index 40f88a91f..6af54d1f1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=6.verified.txt index dfc48fcb4..90f520cd2 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int.verified.txt index 1c933c569..aed0ca33c 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=0.verified.txt index d3928373d..13765ae97 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=2.verified.txt index 2a2c93ce9..a9f6f99a0 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=4.verified.txt index 61aa61a65..36041782e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=6.verified.txt index fa2294ac1..6ac5ce1b5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long.verified.txt index 4e92975c3..5cc618bd1 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=0.verified.txt index c518dc45b..cb19864db 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=2.verified.txt index 82303f637..e8d68c5ff 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=4.verified.txt index 52ead0c20..af8f3d995 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=6.verified.txt index 60cef5093..266e40706 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=0.verified.txt index 708ea8be0..a98a60930 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=0.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=2.verified.txt index 19b9b069f..201ab57e9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=2.verified.txt @@ -46,6 +46,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=4.verified.txt index 3790316cb..350e5f073 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=4.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=6.verified.txt index fe4e5e00a..2a1234e37 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Guid_implementations=6.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int.verified.txt index 51d843c40..44cc6f657 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=0.verified.txt index 4a0f22752..e2e89b0bd 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=2.verified.txt index 1bb8a428f..e6f9db106 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=4.verified.txt index 10f78b6e0..9c0727e64 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=6.verified.txt index 72f8c2993..eb3d106a9 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long.verified.txt index 17215bf51..8b97b596e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long.verified.txt @@ -43,6 +43,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=0.verified.txt index 03ed0affb..1b6500dd5 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=0.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=2.verified.txt index 4b8095558..c148285fe 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=2.verified.txt @@ -45,6 +45,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=4.verified.txt index 0d57ec71d..1e5d9386a 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=4.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=6.verified.txt index b241c0dae..b33e6cc70 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=6.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=0.verified.txt index 4cd97ce30..7b65d9372 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=0.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=2.verified.txt index 71ea2e49a..cac2ba620 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=2.verified.txt @@ -47,6 +47,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=4.verified.txt index 72f4e6109..543e32150 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=4.verified.txt @@ -48,6 +48,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=6.verified.txt index d7a3ed3e7..660fa0a62 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Guid_implementations=6.verified.txt @@ -48,6 +48,16 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + public override bool GeneratesTemporaryValues => false; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + return MyTestId.New(); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int.verified.txt index b7da8e3a0..f9d3c85fa 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=0.verified.txt index 6d0e78a37..5601c8585 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=0.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=2.verified.txt index dd6174a7a..483bb8965 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=2.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=4.verified.txt index a9fbb7dad..26de10c38 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=4.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=6.verified.txt index e7affbacb..36bb54a66 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=6.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private int _id = int.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long.verified.txt index a6cd6a96e..68036f7eb 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long.verified.txt @@ -44,6 +44,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=0.verified.txt index fda121d39..332274827 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=0.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=0.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=2.verified.txt index 2668f3565..fc63bcb93 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=2.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=2.verified.txt @@ -46,6 +46,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=4.verified.txt index 8b214d048..c39f61d0e 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=4.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=4.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { diff --git a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=6.verified.txt index 0a464e952..801f5e4e7 100644 --- a/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=6.verified.txt +++ b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=6.verified.txt @@ -47,6 +47,18 @@ mappingHints ) { } } + + public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator + { + private long _id = long.MinValue; + public override bool GeneratesTemporaryValues => true; + + public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) + { + System.Threading.Interlocked.Increment(ref _id); + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler {