From 35678176f17d9c9416e73009d0ba3eb3e25eb2ee Mon Sep 17 00:00:00 2001 From: Miguel Laranjeira Date: Sat, 13 Aug 2022 21:21:33 +0200 Subject: [PATCH 1/4] Added Value generator creation for EF long and int backed ids --- .../Templates/Int/Int_EfCoreValueConverter.cs | 12 ++++++ .../Long/Long_EfCoreValueConverter.cs | 12 ++++++ .../LongIdTests.cs | 41 +++++++++++++++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=16_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=16_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=18_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=18_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=20_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=20_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=22_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=22_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=24_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=24_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=26_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=26_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=28_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=28_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=30_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=30_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=48_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=50_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=50_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=52_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=52_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=54_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=54_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=56_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=56_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=58_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=58_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=60_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=60_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ ..._converter=62_backingType=Int.verified.txt | 12 ++++++ ...ingType=Int_implementations=0.verified.txt | 12 ++++++ ...ingType=Int_implementations=2.verified.txt | 12 ++++++ ...ingType=Int_implementations=4.verified.txt | 12 ++++++ ...ingType=Int_implementations=6.verified.txt | 12 ++++++ ...converter=62_backingType=Long.verified.txt | 12 ++++++ ...ngType=Long_implementations=0.verified.txt | 12 ++++++ ...ngType=Long_implementations=2.verified.txt | 12 ++++++ ...ngType=Long_implementations=4.verified.txt | 12 ++++++ ...ngType=Long_implementations=6.verified.txt | 12 ++++++ 290 files changed, 3509 insertions(+) diff --git a/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs b/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs index 2245e6cf1..cd7dd6d7d 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) + { + _id += 1; + 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..777ae069e 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) + { + _id += 1; + 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=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..8debaffd6 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) + { + _id += 1; + 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..49a2e3f70 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) + { + _id += 1; + 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..e1690d08e 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) + { + _id += 1; + 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..2f487b36d 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) + { + _id += 1; + 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..a1e176fe1 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) + { + _id += 1; + 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..94d964fe2 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) + { + _id += 1; + 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..b0f106298 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) + { + _id += 1; + 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..9b7ec420f 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) + { + _id += 1; + return new MyTestId(_id); + } + } } } 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..3476afb31 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) + { + _id += 1; + 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..5a0e509d9 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) + { + _id += 1; + 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..daff747dc 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) + { + _id += 1; + 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..8b8a90b78 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) + { + _id += 1; + 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..702211776 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) + { + _id += 1; + 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..16236b8cf 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) + { + _id += 1; + 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..ea5b3c122 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) + { + _id += 1; + 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..155156bef 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..d10ff3828 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) + { + _id += 1; + 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..e5cff53ae 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) + { + _id += 1; + 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..e2242e750 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) + { + _id += 1; + 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..e47d7ae43 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) + { + _id += 1; + 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..f7c56c06c 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) + { + _id += 1; + 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..8c96bacc5 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) + { + _id += 1; + 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..d4cd79c78 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) + { + _id += 1; + 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..e1afc59c0 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { 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..fbd10d5ce 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) + { + _id += 1; + 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..e41e46157 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) + { + _id += 1; + 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..33f28d806 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) + { + _id += 1; + 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..15f68be26 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) + { + _id += 1; + 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..ceeb92bf7 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) + { + _id += 1; + 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..ee6d3f4d4 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) + { + _id += 1; + 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..27002281b 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) + { + _id += 1; + 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..75470fbb4 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..195715ef6 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) + { + _id += 1; + 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..a121afff7 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) + { + _id += 1; + 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..98f2f9087 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) + { + _id += 1; + 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..cb60835e7 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) + { + _id += 1; + 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..2101c7359 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) + { + _id += 1; + 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..66f6728b1 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) + { + _id += 1; + 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..ee3480777 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) + { + _id += 1; + 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..38fe25bbf 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) + { + _id += 1; + 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=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..f4e5cdeaa 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) + { + _id += 1; + 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..e3010821c 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) + { + _id += 1; + 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..d496dc54e 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) + { + _id += 1; + 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..1675bed90 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) + { + _id += 1; + 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..a293e65d7 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) + { + _id += 1; + 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..a20688286 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) + { + _id += 1; + 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..948c6dfdf 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) + { + _id += 1; + 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..8d440d362 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..ad1baea4c 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) + { + _id += 1; + 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..aecb05154 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) + { + _id += 1; + 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..4a9933e16 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) + { + _id += 1; + 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..17524081d 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) + { + _id += 1; + 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..3922819f7 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) + { + _id += 1; + 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..0bbe3f89d 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) + { + _id += 1; + 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..1ddfccf23 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) + { + _id += 1; + 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..62a24d58a 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { 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..92f71ade2 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) + { + _id += 1; + 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..2c3810d07 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) + { + _id += 1; + 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..3442e0f7f 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) + { + _id += 1; + 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..9a1a749ee 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) + { + _id += 1; + 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..03581c310 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) + { + _id += 1; + 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..ff9653892 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) + { + _id += 1; + 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..0648de097 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) + { + _id += 1; + 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..cb1ae5ad3 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..69e5c2d0f 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) + { + _id += 1; + 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..952cce87f 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) + { + _id += 1; + 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..83a9dbe5e 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) + { + _id += 1; + 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..f168cb5b0 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) + { + _id += 1; + 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..09d7186b1 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) + { + _id += 1; + 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..a114cc6dd 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) + { + _id += 1; + 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..928fbb28d 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) + { + _id += 1; + 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..837ad29c1 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=50_backingType=Int_implementations=0.verified.txt index 830548f68..8d0c1dc5f 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) + { + _id += 1; + 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..c6db80860 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) + { + _id += 1; + 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..8f7adc915 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) + { + _id += 1; + 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..3fc73bcd9 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) + { + _id += 1; + 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..492443ff7 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) + { + _id += 1; + 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..30f01be21 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) + { + _id += 1; + 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..6c0d5c84c 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) + { + _id += 1; + 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..59400e93d 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=52_backingType=Int_implementations=0.verified.txt index 4f180eb82..cde6ccc57 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) + { + _id += 1; + 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..c5de0905d 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) + { + _id += 1; + 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..05b3d2570 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) + { + _id += 1; + 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..3c759e8a7 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) + { + _id += 1; + 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..ac809185c 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) + { + _id += 1; + 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..c7ee3b872 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) + { + _id += 1; + 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..def460e16 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) + { + _id += 1; + 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..078696d4d 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=54_backingType=Int_implementations=0.verified.txt index 52d17d86e..5cd7b6f80 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) + { + _id += 1; + 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..85160d78c 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) + { + _id += 1; + 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..5d087b55b 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) + { + _id += 1; + 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..192558b4c 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) + { + _id += 1; + 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..ff94a31c8 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) + { + _id += 1; + 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..a1b4cadaf 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) + { + _id += 1; + 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..5e358229d 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) + { + _id += 1; + 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..bff88b563 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=56_backingType=Int_implementations=0.verified.txt index 09eeb88eb..c182fed83 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) + { + _id += 1; + 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..85001824e 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) + { + _id += 1; + 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..58018b22a 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) + { + _id += 1; + 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..e34117ce5 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) + { + _id += 1; + 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..fd42aaccc 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) + { + _id += 1; + 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..805ebc283 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) + { + _id += 1; + 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..27efbb4b1 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) + { + _id += 1; + 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..8bcf0945f 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=58_backingType=Int_implementations=0.verified.txt index 9f30e3c8a..3976e5020 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) + { + _id += 1; + 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..a72ccf9dd 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) + { + _id += 1; + 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..e1c5b1cba 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) + { + _id += 1; + 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..ceede0145 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) + { + _id += 1; + 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..ba0d6b5ff 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) + { + _id += 1; + 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..d0216514e 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) + { + _id += 1; + 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..0f9eac969 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) + { + _id += 1; + 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..1c0479327 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=60_backingType=Int_implementations=0.verified.txt index bf50776b5..6eca5531d 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) + { + _id += 1; + 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..dcdd8b5b4 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) + { + _id += 1; + 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..116f5603d 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) + { + _id += 1; + 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..c5e1601f9 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) + { + _id += 1; + 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..656091ca8 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) + { + _id += 1; + 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..dbae89690 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) + { + _id += 1; + 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..16298fa00 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) + { + _id += 1; + 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..8f050b67d 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) + { + _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=62_backingType=Int_implementations=0.verified.txt index a2f7eed1b..eb7feeaad 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) + { + _id += 1; + 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..b1001d378 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) + { + _id += 1; + 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..ac5a45fb2 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) + { + _id += 1; + 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..f7659ebab 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) + { + _id += 1; + 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..4af6a6496 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) + { + _id += 1; + 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..83805e656 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) + { + _id += 1; + 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..a2caa37e6 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) + { + _id += 1; + 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..d193006c8 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) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { 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..d79228860 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) + { + _id += 1; + 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..0ba9cbc2a 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) + { + _id += 1; + 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..31687f440 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) + { + _id += 1; + 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..84adf7627 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) + { + _id += 1; + 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..23cbe9c1d 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) + { + _id += 1; + 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..8f437d4dd 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) + { + _id += 1; + 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..22797082b 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) + { + _id += 1; + 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..2a54aa639 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) + { + _id += 1; + return new MyTestId(_id); + } + } } 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..ec6070375 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=2.verified.txt index f2562c2ed..a83c8030e 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=4.verified.txt index 75f28ad18..577694750 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=6.verified.txt index e14dde339..588feb290 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) + { + _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.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..f38aab403 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=2.verified.txt index 66632ba08..7de4604e4 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=4.verified.txt index 76acb43d2..32c6fbade 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Long_implementations=6.verified.txt index ef65e5b9d..7363f4da3 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..0537c8af4 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=2.verified.txt index cf0ea31f5..faee6e785 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=4.verified.txt index b657266e5..4a51f4c78 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=6.verified.txt index 8c5cbf33c..1a649c2ac 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) + { + _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.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..8863153e5 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=2.verified.txt index ff4ab817f..598331814 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=4.verified.txt index 6ca5cdcb4..fbb926ae9 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Long_implementations=6.verified.txt index 62179e110..50586f198 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { 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..88946b049 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=2.verified.txt index 070ac005d..a798a9912 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=4.verified.txt index d1700fa01..5bf3ef45d 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=6.verified.txt index 9c2b9ddaf..0d8549882 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) + { + _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.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..e7ea1e91b 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=2.verified.txt index 6c9ac56cd..684668cef 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=4.verified.txt index db563c670..12d266bd6 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Long_implementations=6.verified.txt index 3492a3860..a1c7fe7db 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..717438390 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=2.verified.txt index 1f67e3e4b..d7b3fc9b7 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=4.verified.txt index fed6ab8b0..55779cb5f 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=6.verified.txt index 54704e2a9..eb71324bf 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) + { + _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.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..1bccbdbe6 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=2.verified.txt index b42ebab87..9942bf7c2 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=4.verified.txt index f340a7c78..2ae55a4ec 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Long_implementations=6.verified.txt index d9fcaa98a..12c432d90 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter { 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..3d88256b7 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=2.verified.txt index 4fa0b420d..adc4922a2 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=4.verified.txt index e1c40915d..daabacb31 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=6.verified.txt index c261528c6..de2d03dd4 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) + { + _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.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..09d25db60 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=2.verified.txt index 6f5ac7b23..b5bf161fa 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=4.verified.txt index 4bbcc932a..1908c9d7f 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Long_implementations=6.verified.txt index f3eb336e3..c7bed6570 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..91491dd9b 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=2.verified.txt index 18c5e7a5d..0d49ed936 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=4.verified.txt index d7f221f75..bf063b9d3 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=6.verified.txt index 5674055a8..81fcb608e 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) + { + _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.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..68931d8b7 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=2.verified.txt index 4d6f17df0..8d7352b6b 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=4.verified.txt index c5f5fbcad..6aa49cc2a 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Long_implementations=6.verified.txt index 036787a5a..b04701331 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter { 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..38480e281 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=2.verified.txt index a89f12ed3..813ea4891 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=4.verified.txt index 7f20719fe..279c4463a 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=6.verified.txt index 255308e13..d38c6121a 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) + { + _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.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..44c661201 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=2.verified.txt index 3821a625f..600ca46d3 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=4.verified.txt index 878302f71..d4ec1e530 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Long_implementations=6.verified.txt index d899d420a..9a17feafa 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) + { + _id += 1; + return new MyTestId(_id); + } + } class MyTestIdTypeConverter : System.ComponentModel.TypeConverter { 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..c8157d02b 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) + { + _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=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=2.verified.txt index d9d59241a..0610f2cc3 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) + { + _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=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=4.verified.txt index 4a3a7fc71..5fbc9ebfc 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) + { + _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=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Int_implementations=6.verified.txt index aecca7dd5..bc79d06db 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) + { + _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.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..0e4e185f3 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=2.verified.txt index 094e8c23a..abd2f036d 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=4.verified.txt index 42f4d0210..eac0a51ae 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=48_backingType=Long_implementations=6.verified.txt index 1f0d97b99..8de1aa044 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) + { + _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.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..eb19a31ac 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=2.verified.txt index 0bd6478f4..6c7411a5b 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=4.verified.txt index 1113add5e..24bc491af 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=6.verified.txt index 277861014..5c2441e55 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) + { + _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.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..48d960fe8 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=2.verified.txt index c27caa895..0e9cdd039 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=4.verified.txt index 249cfaa30..cda37545c 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Long_implementations=6.verified.txt index a6ee535d0..3609f85f4 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) + { + _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.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..9ecfdb26d 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=2.verified.txt index 067afdeaf..5aa561a52 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=4.verified.txt index 977ab2987..ad7624835 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=6.verified.txt index 7e54c92f3..b812581ce 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) + { + _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.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..c940d60ef 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=2.verified.txt index 44d62b358..1fa4c1c11 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=4.verified.txt index 8ea7a51aa..c6bcf098c 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Long_implementations=6.verified.txt index 2d1d13de7..050eaf58c 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) + { + _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.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..9b40e47ee 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=2.verified.txt index 05611cab9..e505a053f 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=4.verified.txt index 753376c71..fdd76947f 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=6.verified.txt index ba470f0ae..3f6c7a852 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) + { + _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.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..43b03af07 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=2.verified.txt index bfda82ce1..d4d56edc2 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=4.verified.txt index b5fcd80eb..cafcbe294 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Long_implementations=6.verified.txt index 983cd47f5..a09584c6e 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) + { + _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.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..4ed4c5c8c 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=2.verified.txt index d0646dc1f..e2f8f26aa 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=4.verified.txt index 37da18f5d..0832ed437 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=6.verified.txt index 5cc2aa633..dbc0c0935 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) + { + _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.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..573e315a4 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=2.verified.txt index bcd1d22f5..535372b15 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=4.verified.txt index f83fe861f..fc940c3db 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Long_implementations=6.verified.txt index ae9b13330..84ee1f091 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) + { + _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.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..361ddd9e5 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=2.verified.txt index 2a2c93ce9..a8d1186d9 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=4.verified.txt index 61aa61a65..c1e887238 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=6.verified.txt index fa2294ac1..bacdfe78f 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) + { + _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.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..362b01eab 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=2.verified.txt index 82303f637..0c8e0fa74 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=4.verified.txt index 52ead0c20..cd9b9565e 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Long_implementations=6.verified.txt index 60cef5093..8156b5eca 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) + { + _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.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..aca44552f 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=2.verified.txt index 1bb8a428f..9415c15aa 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=4.verified.txt index 10f78b6e0..506384fe2 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=6.verified.txt index 72f8c2993..5acde7760 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) + { + _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.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..4e9a7f4ed 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=2.verified.txt index 4b8095558..c926eb45a 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=4.verified.txt index 0d57ec71d..5e6c679da 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Long_implementations=6.verified.txt index b241c0dae..dc592a529 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) + { + _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.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..d357cd26b 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=2.verified.txt index dd6174a7a..efec26729 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=4.verified.txt index a9fbb7dad..2367d1511 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=6.verified.txt index e7affbacb..f1afd1a13 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) + { + _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.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..5ac262296 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) + { + _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=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=2.verified.txt index 2668f3565..0dc6bce19 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) + { + _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=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=4.verified.txt index 8b214d048..a03212f64 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) + { + _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=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Long_implementations=6.verified.txt index 0a464e952..bb7724ae0 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) + { + _id += 1; + return new MyTestId(_id); + } + } public class DapperTypeHandler : Dapper.SqlMapper.TypeHandler { From 4dfd6003177bbc8ebcf1e4a2fd77a0405a3cd66b Mon Sep 17 00:00:00 2001 From: Miguel Laranjeira Date: Sun, 4 Sep 2022 21:31:29 +0200 Subject: [PATCH 2/4] Added Multi-Thread support for temp id generation --- src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs | 2 +- .../Templates/Long/Long_EfCoreValueConverter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs b/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs index cd7dd6d7d..a17fa3169 100644 --- a/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs +++ b/src/StronglyTypedIds/Templates/Int/Int_EfCoreValueConverter.cs @@ -17,7 +17,7 @@ public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneratio public override TESTID Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 777ae069e..eb610437f 100644 --- a/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs +++ b/src/StronglyTypedIds/Templates/Long/Long_EfCoreValueConverter.cs @@ -17,7 +17,7 @@ public class EfCoreValueGenerator : Microsoft.EntityFrameworkCore.ValueGeneratio public override TESTID Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new TESTID(_id); } } \ No newline at end of file From ee78d915c94ac419c1d2088b4c60b7577b1db308 Mon Sep 17 00:00:00 2001 From: Miguel Laranjeira Date: Sun, 4 Sep 2022 21:32:07 +0200 Subject: [PATCH 3/4] Added GUID Value generator --- .../Templates/Guid/Guid_EfCoreValueConverter.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 From e00d60970750e7b03bb3780a4a71a21bf12c649c Mon Sep 17 00:00:00 2001 From: Miguel Laranjeira Date: Sun, 4 Sep 2022 21:33:48 +0200 Subject: [PATCH 4/4] Updated Unit Tests --- ...=16_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=16_backingType=Int_implementations=0.verified.txt | 2 +- ...r=16_backingType=Int_implementations=2.verified.txt | 2 +- ...r=16_backingType=Int_implementations=4.verified.txt | 2 +- ...r=16_backingType=Int_implementations=6.verified.txt | 2 +- ...=16_backingType=Long_implementations=0.verified.txt | 2 +- ...=16_backingType=Long_implementations=2.verified.txt | 2 +- ...=16_backingType=Long_implementations=4.verified.txt | 2 +- ...=16_backingType=Long_implementations=6.verified.txt | 2 +- ...=18_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=18_backingType=Int_implementations=0.verified.txt | 2 +- ...r=18_backingType=Int_implementations=2.verified.txt | 2 +- ...r=18_backingType=Int_implementations=4.verified.txt | 2 +- ...r=18_backingType=Int_implementations=6.verified.txt | 2 +- ...=18_backingType=Long_implementations=0.verified.txt | 2 +- ...=18_backingType=Long_implementations=2.verified.txt | 2 +- ...=18_backingType=Long_implementations=4.verified.txt | 2 +- ...=18_backingType=Long_implementations=6.verified.txt | 2 +- ...=20_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=20_backingType=Int_implementations=0.verified.txt | 2 +- ...r=20_backingType=Int_implementations=2.verified.txt | 2 +- ...r=20_backingType=Int_implementations=4.verified.txt | 2 +- ...r=20_backingType=Int_implementations=6.verified.txt | 2 +- ...=20_backingType=Long_implementations=0.verified.txt | 2 +- ...=20_backingType=Long_implementations=2.verified.txt | 2 +- ...=20_backingType=Long_implementations=4.verified.txt | 2 +- ...=20_backingType=Long_implementations=6.verified.txt | 2 +- ...=22_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=22_backingType=Int_implementations=0.verified.txt | 2 +- ...r=22_backingType=Int_implementations=2.verified.txt | 2 +- ...r=22_backingType=Int_implementations=4.verified.txt | 2 +- ...r=22_backingType=Int_implementations=6.verified.txt | 2 +- ...=22_backingType=Long_implementations=0.verified.txt | 2 +- ...=22_backingType=Long_implementations=2.verified.txt | 2 +- ...=22_backingType=Long_implementations=4.verified.txt | 2 +- ...=22_backingType=Long_implementations=6.verified.txt | 2 +- ...=24_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=24_backingType=Int_implementations=0.verified.txt | 2 +- ...r=24_backingType=Int_implementations=2.verified.txt | 2 +- ...r=24_backingType=Int_implementations=4.verified.txt | 2 +- ...r=24_backingType=Int_implementations=6.verified.txt | 2 +- ...=24_backingType=Long_implementations=0.verified.txt | 2 +- ...=24_backingType=Long_implementations=2.verified.txt | 2 +- ...=24_backingType=Long_implementations=4.verified.txt | 2 +- ...=24_backingType=Long_implementations=6.verified.txt | 2 +- ...=26_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=26_backingType=Int_implementations=0.verified.txt | 2 +- ...r=26_backingType=Int_implementations=2.verified.txt | 2 +- ...r=26_backingType=Int_implementations=4.verified.txt | 2 +- ...r=26_backingType=Int_implementations=6.verified.txt | 2 +- ...=26_backingType=Long_implementations=0.verified.txt | 2 +- ...=26_backingType=Long_implementations=2.verified.txt | 2 +- ...=26_backingType=Long_implementations=4.verified.txt | 2 +- ...=26_backingType=Long_implementations=6.verified.txt | 2 +- ...=28_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=28_backingType=Int_implementations=0.verified.txt | 2 +- ...r=28_backingType=Int_implementations=2.verified.txt | 2 +- ...r=28_backingType=Int_implementations=4.verified.txt | 2 +- ...r=28_backingType=Int_implementations=6.verified.txt | 2 +- ...=28_backingType=Long_implementations=0.verified.txt | 2 +- ...=28_backingType=Long_implementations=2.verified.txt | 2 +- ...=28_backingType=Long_implementations=4.verified.txt | 2 +- ...=28_backingType=Long_implementations=6.verified.txt | 2 +- ...=30_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=30_backingType=Int_implementations=0.verified.txt | 2 +- ...r=30_backingType=Int_implementations=2.verified.txt | 2 +- ...r=30_backingType=Int_implementations=4.verified.txt | 2 +- ...r=30_backingType=Int_implementations=6.verified.txt | 2 +- ...=30_backingType=Long_implementations=0.verified.txt | 2 +- ...=30_backingType=Long_implementations=2.verified.txt | 2 +- ...=30_backingType=Long_implementations=4.verified.txt | 2 +- ...=30_backingType=Long_implementations=6.verified.txt | 2 +- ...=48_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=48_backingType=Int_implementations=0.verified.txt | 2 +- ...r=48_backingType=Int_implementations=2.verified.txt | 2 +- ...r=48_backingType=Int_implementations=4.verified.txt | 2 +- ...r=48_backingType=Int_implementations=6.verified.txt | 2 +- ...=48_backingType=Long_implementations=0.verified.txt | 2 +- ...=48_backingType=Long_implementations=2.verified.txt | 2 +- ...=48_backingType=Long_implementations=4.verified.txt | 2 +- ...=48_backingType=Long_implementations=6.verified.txt | 2 +- ...=50_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=50_backingType=Int_implementations=0.verified.txt | 2 +- ...r=50_backingType=Int_implementations=2.verified.txt | 2 +- ...r=50_backingType=Int_implementations=4.verified.txt | 2 +- ...r=50_backingType=Int_implementations=6.verified.txt | 2 +- ...=50_backingType=Long_implementations=0.verified.txt | 2 +- ...=50_backingType=Long_implementations=2.verified.txt | 2 +- ...=50_backingType=Long_implementations=4.verified.txt | 2 +- ...=50_backingType=Long_implementations=6.verified.txt | 2 +- ...=52_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=52_backingType=Int_implementations=0.verified.txt | 2 +- ...r=52_backingType=Int_implementations=2.verified.txt | 2 +- ...r=52_backingType=Int_implementations=4.verified.txt | 2 +- ...r=52_backingType=Int_implementations=6.verified.txt | 2 +- ...=52_backingType=Long_implementations=0.verified.txt | 2 +- ...=52_backingType=Long_implementations=2.verified.txt | 2 +- ...=52_backingType=Long_implementations=4.verified.txt | 2 +- ...=52_backingType=Long_implementations=6.verified.txt | 2 +- ...=54_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=54_backingType=Int_implementations=0.verified.txt | 2 +- ...r=54_backingType=Int_implementations=2.verified.txt | 2 +- ...r=54_backingType=Int_implementations=4.verified.txt | 2 +- ...r=54_backingType=Int_implementations=6.verified.txt | 2 +- ...=54_backingType=Long_implementations=0.verified.txt | 2 +- ...=54_backingType=Long_implementations=2.verified.txt | 2 +- ...=54_backingType=Long_implementations=4.verified.txt | 2 +- ...=54_backingType=Long_implementations=6.verified.txt | 2 +- ...=56_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=56_backingType=Int_implementations=0.verified.txt | 2 +- ...r=56_backingType=Int_implementations=2.verified.txt | 2 +- ...r=56_backingType=Int_implementations=4.verified.txt | 2 +- ...r=56_backingType=Int_implementations=6.verified.txt | 2 +- ...=56_backingType=Long_implementations=0.verified.txt | 2 +- ...=56_backingType=Long_implementations=2.verified.txt | 2 +- ...=56_backingType=Long_implementations=4.verified.txt | 2 +- ...=56_backingType=Long_implementations=6.verified.txt | 2 +- ...=58_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=58_backingType=Int_implementations=0.verified.txt | 2 +- ...r=58_backingType=Int_implementations=2.verified.txt | 2 +- ...r=58_backingType=Int_implementations=4.verified.txt | 2 +- ...r=58_backingType=Int_implementations=6.verified.txt | 2 +- ...=58_backingType=Long_implementations=0.verified.txt | 2 +- ...=58_backingType=Long_implementations=2.verified.txt | 2 +- ...=58_backingType=Long_implementations=4.verified.txt | 2 +- ...=58_backingType=Long_implementations=6.verified.txt | 2 +- ...=60_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=60_backingType=Int_implementations=0.verified.txt | 2 +- ...r=60_backingType=Int_implementations=2.verified.txt | 2 +- ...r=60_backingType=Int_implementations=4.verified.txt | 2 +- ...r=60_backingType=Int_implementations=6.verified.txt | 2 +- ...=60_backingType=Long_implementations=0.verified.txt | 2 +- ...=60_backingType=Long_implementations=2.verified.txt | 2 +- ...=60_backingType=Long_implementations=4.verified.txt | 2 +- ...=60_backingType=Long_implementations=6.verified.txt | 2 +- ...=62_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=62_backingType=Int_implementations=0.verified.txt | 2 +- ...r=62_backingType=Int_implementations=2.verified.txt | 2 +- ...r=62_backingType=Int_implementations=4.verified.txt | 2 +- ...r=62_backingType=Int_implementations=6.verified.txt | 2 +- ...=62_backingType=Long_implementations=0.verified.txt | 2 +- ...=62_backingType=Long_implementations=2.verified.txt | 2 +- ...=62_backingType=Long_implementations=4.verified.txt | 2 +- ...=62_backingType=Long_implementations=6.verified.txt | 2 +- ...=16_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=16_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=16_backingType=Int_implementations=0.verified.txt | 2 +- ...r=16_backingType=Int_implementations=2.verified.txt | 2 +- ...r=16_backingType=Int_implementations=4.verified.txt | 2 +- ...r=16_backingType=Int_implementations=6.verified.txt | 2 +- ...=16_backingType=Long_implementations=0.verified.txt | 2 +- ...=16_backingType=Long_implementations=2.verified.txt | 2 +- ...=16_backingType=Long_implementations=4.verified.txt | 2 +- ...=16_backingType=Long_implementations=6.verified.txt | 2 +- ...=18_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=18_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=18_backingType=Int_implementations=0.verified.txt | 2 +- ...r=18_backingType=Int_implementations=2.verified.txt | 2 +- ...r=18_backingType=Int_implementations=4.verified.txt | 2 +- ...r=18_backingType=Int_implementations=6.verified.txt | 2 +- ...=18_backingType=Long_implementations=0.verified.txt | 2 +- ...=18_backingType=Long_implementations=2.verified.txt | 2 +- ...=18_backingType=Long_implementations=4.verified.txt | 2 +- ...=18_backingType=Long_implementations=6.verified.txt | 2 +- ...=20_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=20_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=20_backingType=Int_implementations=0.verified.txt | 2 +- ...r=20_backingType=Int_implementations=2.verified.txt | 2 +- ...r=20_backingType=Int_implementations=4.verified.txt | 2 +- ...r=20_backingType=Int_implementations=6.verified.txt | 2 +- ...=20_backingType=Long_implementations=0.verified.txt | 2 +- ...=20_backingType=Long_implementations=2.verified.txt | 2 +- ...=20_backingType=Long_implementations=4.verified.txt | 2 +- ...=20_backingType=Long_implementations=6.verified.txt | 2 +- ...=22_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=22_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=22_backingType=Int_implementations=0.verified.txt | 2 +- ...r=22_backingType=Int_implementations=2.verified.txt | 2 +- ...r=22_backingType=Int_implementations=4.verified.txt | 2 +- ...r=22_backingType=Int_implementations=6.verified.txt | 2 +- ...=22_backingType=Long_implementations=0.verified.txt | 2 +- ...=22_backingType=Long_implementations=2.verified.txt | 2 +- ...=22_backingType=Long_implementations=4.verified.txt | 2 +- ...=22_backingType=Long_implementations=6.verified.txt | 2 +- ...=24_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=24_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=24_backingType=Int_implementations=0.verified.txt | 2 +- ...r=24_backingType=Int_implementations=2.verified.txt | 2 +- ...r=24_backingType=Int_implementations=4.verified.txt | 2 +- ...r=24_backingType=Int_implementations=6.verified.txt | 2 +- ...=24_backingType=Long_implementations=0.verified.txt | 2 +- ...=24_backingType=Long_implementations=2.verified.txt | 2 +- ...=24_backingType=Long_implementations=4.verified.txt | 2 +- ...=24_backingType=Long_implementations=6.verified.txt | 2 +- ...=26_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=26_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=26_backingType=Int_implementations=0.verified.txt | 2 +- ...r=26_backingType=Int_implementations=2.verified.txt | 2 +- ...r=26_backingType=Int_implementations=4.verified.txt | 2 +- ...r=26_backingType=Int_implementations=6.verified.txt | 2 +- ...=26_backingType=Long_implementations=0.verified.txt | 2 +- ...=26_backingType=Long_implementations=2.verified.txt | 2 +- ...=26_backingType=Long_implementations=4.verified.txt | 2 +- ...=26_backingType=Long_implementations=6.verified.txt | 2 +- ...=28_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=28_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=28_backingType=Int_implementations=0.verified.txt | 2 +- ...r=28_backingType=Int_implementations=2.verified.txt | 2 +- ...r=28_backingType=Int_implementations=4.verified.txt | 2 +- ...r=28_backingType=Int_implementations=6.verified.txt | 2 +- ...=28_backingType=Long_implementations=0.verified.txt | 2 +- ...=28_backingType=Long_implementations=2.verified.txt | 2 +- ...=28_backingType=Long_implementations=4.verified.txt | 2 +- ...=28_backingType=Long_implementations=6.verified.txt | 2 +- ...=30_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=30_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=30_backingType=Int_implementations=0.verified.txt | 2 +- ...r=30_backingType=Int_implementations=2.verified.txt | 2 +- ...r=30_backingType=Int_implementations=4.verified.txt | 2 +- ...r=30_backingType=Int_implementations=6.verified.txt | 2 +- ...=30_backingType=Long_implementations=0.verified.txt | 2 +- ...=30_backingType=Long_implementations=2.verified.txt | 2 +- ...=30_backingType=Long_implementations=4.verified.txt | 2 +- ...=30_backingType=Long_implementations=6.verified.txt | 2 +- ...=48_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=48_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=48_backingType=Int_implementations=0.verified.txt | 2 +- ...r=48_backingType=Int_implementations=2.verified.txt | 2 +- ...r=48_backingType=Int_implementations=4.verified.txt | 2 +- ...r=48_backingType=Int_implementations=6.verified.txt | 2 +- ...=48_backingType=Long_implementations=0.verified.txt | 2 +- ...=48_backingType=Long_implementations=2.verified.txt | 2 +- ...=48_backingType=Long_implementations=4.verified.txt | 2 +- ...=48_backingType=Long_implementations=6.verified.txt | 2 +- ...=50_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=50_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=50_backingType=Int_implementations=0.verified.txt | 2 +- ...r=50_backingType=Int_implementations=2.verified.txt | 2 +- ...r=50_backingType=Int_implementations=4.verified.txt | 2 +- ...r=50_backingType=Int_implementations=6.verified.txt | 2 +- ...=50_backingType=Long_implementations=0.verified.txt | 2 +- ...=50_backingType=Long_implementations=2.verified.txt | 2 +- ...=50_backingType=Long_implementations=4.verified.txt | 2 +- ...=50_backingType=Long_implementations=6.verified.txt | 2 +- ...=52_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=52_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=52_backingType=Int_implementations=0.verified.txt | 2 +- ...r=52_backingType=Int_implementations=2.verified.txt | 2 +- ...r=52_backingType=Int_implementations=4.verified.txt | 2 +- ...r=52_backingType=Int_implementations=6.verified.txt | 2 +- ...=52_backingType=Long_implementations=0.verified.txt | 2 +- ...=52_backingType=Long_implementations=2.verified.txt | 2 +- ...=52_backingType=Long_implementations=4.verified.txt | 2 +- ...=52_backingType=Long_implementations=6.verified.txt | 2 +- ...=54_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=54_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=54_backingType=Int_implementations=0.verified.txt | 2 +- ...r=54_backingType=Int_implementations=2.verified.txt | 2 +- ...r=54_backingType=Int_implementations=4.verified.txt | 2 +- ...r=54_backingType=Int_implementations=6.verified.txt | 2 +- ...=54_backingType=Long_implementations=0.verified.txt | 2 +- ...=54_backingType=Long_implementations=2.verified.txt | 2 +- ...=54_backingType=Long_implementations=4.verified.txt | 2 +- ...=54_backingType=Long_implementations=6.verified.txt | 2 +- ...=56_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=56_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=56_backingType=Int_implementations=0.verified.txt | 2 +- ...r=56_backingType=Int_implementations=2.verified.txt | 2 +- ...r=56_backingType=Int_implementations=4.verified.txt | 2 +- ...r=56_backingType=Int_implementations=6.verified.txt | 2 +- ...=56_backingType=Long_implementations=0.verified.txt | 2 +- ...=56_backingType=Long_implementations=2.verified.txt | 2 +- ...=56_backingType=Long_implementations=4.verified.txt | 2 +- ...=56_backingType=Long_implementations=6.verified.txt | 2 +- ...=58_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=58_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=58_backingType=Int_implementations=0.verified.txt | 2 +- ...r=58_backingType=Int_implementations=2.verified.txt | 2 +- ...r=58_backingType=Int_implementations=4.verified.txt | 2 +- ...r=58_backingType=Int_implementations=6.verified.txt | 2 +- ...=58_backingType=Long_implementations=0.verified.txt | 2 +- ...=58_backingType=Long_implementations=2.verified.txt | 2 +- ...=58_backingType=Long_implementations=4.verified.txt | 2 +- ...=58_backingType=Long_implementations=6.verified.txt | 2 +- ...=60_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=60_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=60_backingType=Int_implementations=0.verified.txt | 2 +- ...r=60_backingType=Int_implementations=2.verified.txt | 2 +- ...r=60_backingType=Int_implementations=4.verified.txt | 2 +- ...r=60_backingType=Int_implementations=6.verified.txt | 2 +- ...=60_backingType=Long_implementations=0.verified.txt | 2 +- ...=60_backingType=Long_implementations=2.verified.txt | 2 +- ...=60_backingType=Long_implementations=4.verified.txt | 2 +- ...=60_backingType=Long_implementations=6.verified.txt | 2 +- ...=62_backingType=Guid_implementations=0.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=2.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=4.verified.txt | 10 ++++++++++ ...=62_backingType=Guid_implementations=6.verified.txt | 10 ++++++++++ ...r=62_backingType=Int_implementations=0.verified.txt | 2 +- ...r=62_backingType=Int_implementations=2.verified.txt | 2 +- ...r=62_backingType=Int_implementations=4.verified.txt | 2 +- ...r=62_backingType=Int_implementations=6.verified.txt | 2 +- ...=62_backingType=Long_implementations=0.verified.txt | 2 +- ...=62_backingType=Long_implementations=2.verified.txt | 2 +- ...=62_backingType=Long_implementations=4.verified.txt | 2 +- ...=62_backingType=Long_implementations=6.verified.txt | 2 +- 384 files changed, 1536 insertions(+), 256 deletions(-) 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 8debaffd6..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 49a2e3f70..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 e1690d08e..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 2f487b36d..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 a1e176fe1..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 94d964fe2..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 b0f106298..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 9b7ec420f..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 3476afb31..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Int_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=2.verified.txt index 5a0e509d9..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Int_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=4.verified.txt index daff747dc..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Int_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Int_implementations=6.verified.txt index 8b8a90b78..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Long_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=0.verified.txt index 702211776..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Long_implementations=2.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=2.verified.txt index 16236b8cf..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Long_implementations=4.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=4.verified.txt index ea5b3c122..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=Long_implementations=6.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=Some.Namespace_converter=18_backingType=Long_implementations=6.verified.txt index 155156bef..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d10ff3828..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e5cff53ae..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e2242e750..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e47d7ae43..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f7c56c06c..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8c96bacc5..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d4cd79c78..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e1afc59c0..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 fbd10d5ce..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e41e46157..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 33f28d806..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 15f68be26..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ceeb92bf7..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ee6d3f4d4..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 27002281b..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 75470fbb4..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 195715ef6..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a121afff7..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 98f2f9087..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cb60835e7..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 2101c7359..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 66f6728b1..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ee3480777..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 38fe25bbf..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f4e5cdeaa..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e3010821c..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d496dc54e..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1675bed90..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a293e65d7..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a20688286..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 948c6dfdf..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8d440d362..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ad1baea4c..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 aecb05154..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 4a9933e16..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 17524081d..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3922819f7..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0bbe3f89d..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1ddfccf23..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 62a24d58a..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 92f71ade2..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 2c3810d07..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3442e0f7f..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 9a1a749ee..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 03581c310..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ff9653892..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0648de097..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cb1ae5ad3..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 69e5c2d0f..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 952cce87f..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 83a9dbe5e..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f168cb5b0..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 09d7186b1..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a114cc6dd..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 @@ -53,7 +53,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 928fbb28d..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 837ad29c1..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8d0c1dc5f..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c6db80860..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8f7adc915..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3fc73bcd9..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 492443ff7..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 30f01be21..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 6c0d5c84c..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 59400e93d..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cde6ccc57..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c5de0905d..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 05b3d2570..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3c759e8a7..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ac809185c..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c7ee3b872..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 def460e16..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 078696d4d..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5cd7b6f80..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 85160d78c..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5d087b55b..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 192558b4c..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ff94a31c8..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a1b4cadaf..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5e358229d..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 bff88b563..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c182fed83..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 85001824e..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 58018b22a..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e34117ce5..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 fd42aaccc..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 805ebc283..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 @@ -54,7 +54,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 27efbb4b1..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8bcf0945f..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3976e5020..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a72ccf9dd..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e1c5b1cba..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ceede0145..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ba0d6b5ff..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d0216514e..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0f9eac969..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1c0479327..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 6eca5531d..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 dcdd8b5b4..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 116f5603d..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c5e1601f9..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 656091ca8..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 dbae89690..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 @@ -55,7 +55,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 16298fa00..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8f050b67d..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 eb7feeaad..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 b1001d378..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ac5a45fb2..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f7659ebab..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 4af6a6496..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 83805e656..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 @@ -56,7 +56,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a2caa37e6..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d193006c8..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 @@ -57,7 +57,7 @@ namespace Some.Namespace public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Int_implementations=0.verified.txt index d79228860..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 0ba9cbc2a..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 31687f440..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 84adf7627..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=16_backingType=Long_implementations=0.verified.txt index 23cbe9c1d..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 8f437d4dd..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 22797082b..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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 2a54aa639..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=18_backingType=Int_implementations=0.verified.txt index ec6070375..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a83c8030e..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 577694750..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 588feb290..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f38aab403..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 7de4604e4..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 32c6fbade..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 7363f4da3..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=20_backingType=Int_implementations=0.verified.txt index 0537c8af4..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 faee6e785..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 4a51f4c78..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1a649c2ac..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8863153e5..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 598331814..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 fbb926ae9..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 50586f198..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=22_backingType=Int_implementations=0.verified.txt index 88946b049..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a798a9912..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5bf3ef45d..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0d8549882..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e7ea1e91b..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 684668cef..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 12d266bd6..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a1c7fe7db..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=24_backingType=Int_implementations=0.verified.txt index 717438390..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d7b3fc9b7..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 55779cb5f..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 eb71324bf..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1bccbdbe6..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 9942bf7c2..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 2ae55a4ec..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 12c432d90..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=26_backingType=Int_implementations=0.verified.txt index 3d88256b7..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 adc4922a2..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 daabacb31..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 de2d03dd4..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 09d25db60..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 b5bf161fa..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1908c9d7f..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c7bed6570..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=28_backingType=Int_implementations=0.verified.txt index 91491dd9b..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0d49ed936..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 bf063b9d3..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 81fcb608e..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 68931d8b7..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8d7352b6b..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 6aa49cc2a..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 b04701331..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=30_backingType=Int_implementations=0.verified.txt index 38480e281..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 813ea4891..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 279c4463a..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d38c6121a..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 44c661201..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 600ca46d3..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d4ec1e530..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 9a17feafa..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c8157d02b..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0610f2cc3..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5fbc9ebfc..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 bc79d06db..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0e4e185f3..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 abd2f036d..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 @@ -51,7 +51,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 eac0a51ae..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8de1aa044..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=50_backingType=Int_implementations=0.verified.txt index eb19a31ac..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 6c7411a5b..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 24bc491af..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5c2441e55..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 48d960fe8..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0e9cdd039..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cda37545c..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3609f85f4..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=52_backingType=Int_implementations=0.verified.txt index 9ecfdb26d..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5aa561a52..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 ad7624835..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 b812581ce..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c940d60ef..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 1fa4c1c11..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c6bcf098c..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 050eaf58c..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=54_backingType=Int_implementations=0.verified.txt index 9b40e47ee..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e505a053f..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 fdd76947f..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 3f6c7a852..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 43b03af07..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 d4d56edc2..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cafcbe294..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a09584c6e..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=56_backingType=Int_implementations=0.verified.txt index 4ed4c5c8c..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 e2f8f26aa..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0832ed437..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 dbc0c0935..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 573e315a4..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 535372b15..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 @@ -52,7 +52,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 fc940c3db..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 84ee1f091..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=58_backingType=Int_implementations=0.verified.txt index 361ddd9e5..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a8d1186d9..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c1e887238..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 bacdfe78f..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 362b01eab..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0c8e0fa74..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 cd9b9565e..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 8156b5eca..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=60_backingType=Int_implementations=0.verified.txt index aca44552f..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 9415c15aa..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 506384fe2..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5acde7760..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 4e9a7f4ed..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 c926eb45a..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 @@ -53,7 +53,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5e6c679da..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 dc592a529..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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_implementations=0.verified.txt b/test/StronglyTypedIds.Tests/Snapshots/SourceGenerationHelperSnapshotTests.GeneratesIdCorrectly_ns=_converter=62_backingType=Int_implementations=0.verified.txt index d357cd26b..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 efec26729..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 2367d1511..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 f1afd1a13..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 5ac262296..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 0dc6bce19..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 @@ -54,7 +54,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 a03212f64..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } } 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 bb7724ae0..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 @@ -55,7 +55,7 @@ public override MyTestId Next(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry) { - _id += 1; + System.Threading.Interlocked.Increment(ref _id); return new MyTestId(_id); } }