-
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.
Add relational metadata extensions for conventions.
Refactor relational metadata extensions to be directly defined on the metadata objects. Move conflict resolution between store generated configuration to a convention. Explicit conflicting configuration will now result in an exception. Mark UseSqlServerIdentityColumn() as obsolete in favor of ForSqlServerUseIdentityColumn() Part of #214
- Loading branch information
1 parent
97b7479
commit 469177a
Showing
360 changed files
with
10,157 additions
and
11,361 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
42 changes: 18 additions & 24 deletions
42
src/EFCore.Design/Metadata/Internal/ScaffoldingEntityTypeAnnotations.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 |
---|---|---|
@@ -1,43 +1,37 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Utilities; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Internal | ||
{ | ||
/// <summary> | ||
/// Provides strongly typed access to scaffolding related annotations on an | ||
/// <see cref="IEntityType" /> instance. Instances of this class are typically obtained via the | ||
/// <see cref="ScaffoldingMetadataExtensions.Scaffolding(IEntityType)" /> extension method and it is not designed | ||
/// to be directly constructed in your application code. | ||
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to | ||
/// the same compatibility standards as public APIs. It may be changed or removed without notice in | ||
/// any release. You should only use it directly in your code with extreme caution and knowing that | ||
/// doing so can result in application failures when updating to a new Entity Framework Core release. | ||
/// </summary> | ||
public class ScaffoldingEntityTypeAnnotations : RelationalEntityTypeAnnotations | ||
public static class ScaffoldingEntityTypeAnnotations | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ScaffoldingEntityTypeAnnotations" /> class. | ||
/// Instances of this class are typically obtained via the | ||
/// <see cref="ScaffoldingMetadataExtensions.Scaffolding(IEntityType)" /> extension method and it is not designed | ||
/// to be directly constructed in your application code. | ||
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to | ||
/// the same compatibility standards as public APIs. It may be changed or removed without notice in | ||
/// any release. You should only use it directly in your code with extreme caution and knowing that | ||
/// doing so can result in application failures when updating to a new Entity Framework Core release. | ||
/// </summary> | ||
/// <param name="entity"> The entity type to access annotation on. </param> | ||
public ScaffoldingEntityTypeAnnotations([NotNull] IEntityType entity) | ||
: base(entity) | ||
{ | ||
} | ||
public static string GetDbSetName(this IEntityType entityType) | ||
=> (string)entityType[ScaffoldingAnnotationNames.DbSetName] | ||
?? entityType.Name; | ||
|
||
/// <summary> | ||
/// Gets or set the name of the <see cref="DbSet{TEntity}" /> property for this entity type. | ||
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to | ||
/// the same compatibility standards as public APIs. It may be changed or removed without notice in | ||
/// any release. You should only use it directly in your code with extreme caution and knowing that | ||
/// doing so can result in application failures when updating to a new Entity Framework Core release. | ||
/// </summary> | ||
public virtual string DbSetName | ||
{ | ||
get => (string)Annotations.Metadata[ScaffoldingAnnotationNames.DbSetName] | ||
?? EntityType.Name; | ||
|
||
[param: CanBeNull] | ||
set => Annotations.SetAnnotation( | ||
public static void SetDbSetName(this IMutableEntityType entityType, string value) => | ||
entityType.SetAnnotation( | ||
ScaffoldingAnnotationNames.DbSetName, | ||
Check.NullButNotEmpty(value, nameof(value))); | ||
} | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
src/EFCore.Design/Metadata/Internal/ScaffoldingMetadataExtensions.cs
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
src/EFCore.Design/Metadata/Internal/ScaffoldingModelAnnotations.cs
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.