-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle row-version columns in owned types with conversions
Fixes #29689 Also add more end-to-end tests for optimistic concurrency, converters, owned types, inheritance, and table sharing.
- Loading branch information
1 parent
35e9e5a
commit f10256a
Showing
16 changed files
with
876 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
test/EFCore.Specification.Tests/TestModels/ConcurrencyModel/Circuit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.ConcurrencyModel; | ||
|
||
public interface IStreetCircuit<TCity> | ||
{ | ||
string Name { get; set; } | ||
public TCity City { get; set; } | ||
} | ||
|
||
public abstract class Circuit | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public ulong ULongVersion { get; init; } | ||
|
||
[NotMapped] | ||
public List<byte> BinaryVersion { get; init; } | ||
} | ||
|
||
public class StreetCircuit : Circuit, IStreetCircuit<City> | ||
{ | ||
public class StreetCircuitProxy : StreetCircuit, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Length { get; set; } | ||
|
||
[Required] | ||
public City City { get; set; } | ||
} | ||
|
||
public class OvalCircuit : Circuit | ||
{ | ||
public class OvalCircuitProxy : OvalCircuit, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public double Banking { get; set; } | ||
} |
44 changes: 44 additions & 0 deletions
44
test/EFCore.Specification.Tests/TestModels/ConcurrencyModel/CircuitTpc.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.ConcurrencyModel; | ||
|
||
public abstract class CircuitTpc | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public ulong ULongVersion { get; init; } | ||
|
||
[NotMapped] | ||
public List<byte> BinaryVersion { get; init; } | ||
} | ||
|
||
public class StreetCircuitTpc : CircuitTpc, IStreetCircuit<CityTpc> | ||
{ | ||
public class StreetCircuitTpcProxy : StreetCircuitTpc, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Length { get; set; } | ||
|
||
[Required] | ||
public CityTpc City { get; set; } | ||
} | ||
|
||
public class OvalCircuitTpc : CircuitTpc | ||
{ | ||
public class OvalCircuitTpcProxy : OvalCircuitTpc, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public double Banking { get; set; } | ||
} |
44 changes: 44 additions & 0 deletions
44
test/EFCore.Specification.Tests/TestModels/ConcurrencyModel/CircuitTpt.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.ConcurrencyModel; | ||
|
||
public abstract class CircuitTpt | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public ulong ULongVersion { get; init; } | ||
|
||
[NotMapped] | ||
public List<byte> BinaryVersion { get; init; } | ||
} | ||
|
||
public class StreetCircuitTpt : CircuitTpt, IStreetCircuit<CityTpt> | ||
{ | ||
public class StreetCircuitTptProxy : StreetCircuitTpt, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Length { get; set; } | ||
|
||
[Required] | ||
public CityTpt City { get; set; } | ||
} | ||
|
||
public class OvalCircuitTpt : CircuitTpt | ||
{ | ||
public class OvalCircuitTptProxy : OvalCircuitTpt, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public double Banking { get; set; } | ||
} |
56 changes: 56 additions & 0 deletions
56
test/EFCore.Specification.Tests/TestModels/ConcurrencyModel/City.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Microsoft.EntityFrameworkCore.TestModels.ConcurrencyModel; | ||
|
||
public interface ICity | ||
{ | ||
public string Name { get; set; } | ||
} | ||
|
||
public class City : ICity | ||
{ | ||
public class CityProxy : City, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Id { get; set; } | ||
|
||
[Required] | ||
public string Name { get; set; } | ||
} | ||
|
||
public class CityTpt : ICity | ||
{ | ||
public class CityTptProxy : CityTpt, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Id { get; set; } | ||
|
||
[Required] | ||
public string Name { get; set; } | ||
} | ||
|
||
public class CityTpc : ICity | ||
{ | ||
public class CityTpcProxy : CityTpc, IF1Proxy | ||
{ | ||
public bool CreatedCalled { get; set; } | ||
public bool InitializingCalled { get; set; } | ||
public bool InitializedCalled { get; set; } | ||
} | ||
|
||
public int Id { get; set; } | ||
|
||
[Required] | ||
public string Name { get; set; } | ||
} |
Oops, something went wrong.