-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default type mappings for remaining complex types to support comp…
…iled models in EF Core 8.
- Loading branch information
Showing
10 changed files
with
215 additions
and
7 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
38 changes: 38 additions & 0 deletions
38
src/EFCore.MySql/Design/Internal/MySqlCSharpRuntimeAnnotationCodeGenerator.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,38 @@ | ||
// Copyright (c) Pomelo Foundation. All rights reserved. | ||
// Licensed under the MIT. See LICENSE in the project root for license information. | ||
|
||
using Microsoft.EntityFrameworkCore.ChangeTracking; | ||
using Microsoft.EntityFrameworkCore.Design.Internal; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
using Pomelo.EntityFrameworkCore.MySql.Storage.Internal; | ||
|
||
namespace Pomelo.EntityFrameworkCore.MySql.Design.Internal; | ||
|
||
public class MySqlCSharpRuntimeAnnotationCodeGenerator : RelationalCSharpRuntimeAnnotationCodeGenerator | ||
{ | ||
public MySqlCSharpRuntimeAnnotationCodeGenerator( | ||
CSharpRuntimeAnnotationCodeGeneratorDependencies dependencies, | ||
RelationalCSharpRuntimeAnnotationCodeGeneratorDependencies relationalDependencies) | ||
: base(dependencies, relationalDependencies) | ||
{ | ||
} | ||
|
||
public override bool Create( | ||
CoreTypeMapping typeMapping, | ||
CSharpRuntimeAnnotationCodeGeneratorParameters parameters, | ||
ValueComparer valueComparer = null, | ||
ValueComparer keyValueComparer = null, | ||
ValueComparer providerValueComparer = null) | ||
{ | ||
var result = base.Create(typeMapping, parameters, valueComparer, keyValueComparer, providerValueComparer); | ||
|
||
if (typeMapping is IMySqlCSharpRuntimeAnnotationTypeMappingCodeGenerator extension) | ||
{ | ||
extension.Create( | ||
CreateDefaultTypeMapping(typeMapping, parameters), | ||
parameters); | ||
} | ||
|
||
return result; | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/EFCore.MySql/Storage/Internal/IMySqlCSharpRuntimeAnnotationTypeMappingCodeGenerator.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,14 @@ | ||
// Copyright (c) Pomelo Foundation. All rights reserved. | ||
// Licensed under the MIT. See LICENSE in the project root for license information. | ||
|
||
using Microsoft.EntityFrameworkCore.Design.Internal; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
|
||
namespace Pomelo.EntityFrameworkCore.MySql.Storage.Internal; | ||
|
||
public interface IMySqlCSharpRuntimeAnnotationTypeMappingCodeGenerator | ||
{ | ||
void Create( | ||
CoreTypeMapping defaultTypeMapping, | ||
CSharpRuntimeAnnotationCodeGeneratorParameters parameters); | ||
} |
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