-
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 view support to the relational model API
Use the new model in the query pipeline Fixes #12846
- Loading branch information
1 parent
1a73b7e
commit 9cce8fc
Showing
37 changed files
with
1,431 additions
and
253 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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 System.Collections.Generic; | ||
using JetBrains.Annotations; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents a view in the database. | ||
/// </summary> | ||
public interface IView : ITableBase | ||
{ | ||
/// <summary> | ||
/// The entity type mappings. | ||
/// </summary> | ||
new IEnumerable<IViewMapping> EntityTypeMappings { get; } | ||
|
||
/// <summary> | ||
/// The columns defined for this view. | ||
/// </summary> | ||
new IEnumerable<IViewColumn> Columns { get; } | ||
|
||
/// <summary> | ||
/// Returns the column with a given name. Returns <c>null</c> if no column with the given name is defined. | ||
/// </summary> | ||
new IViewColumn FindColumn([NotNull] string name); | ||
|
||
/// <summary> | ||
/// The view definition or <c>null</c> if this view is not managed by migrations. | ||
/// </summary> | ||
public string ViewDefinition { get; } | ||
} | ||
} |
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,23 @@ | ||
// 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 System.Collections.Generic; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents a column in a view. | ||
/// </summary> | ||
public interface IViewColumn : IColumnBase | ||
{ | ||
/// <summary> | ||
/// The containing view. | ||
/// </summary> | ||
IView View { get; } | ||
|
||
/// <summary> | ||
/// The property mappings. | ||
/// </summary> | ||
new IEnumerable<IViewColumnMapping> PropertyMappings { get; } | ||
} | ||
} |
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,21 @@ | ||
// 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. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents property mapping to a column. | ||
/// </summary> | ||
public interface IViewColumnMapping : IColumnMappingBase | ||
{ | ||
/// <summary> | ||
/// The target column. | ||
/// </summary> | ||
new IViewColumn Column { get; } | ||
|
||
/// <summary> | ||
/// The containing view mapping. | ||
/// </summary> | ||
IViewMapping ViewMapping { get; } | ||
} | ||
} |
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,23 @@ | ||
// 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 System.Collections.Generic; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents entity type mapping to a view. | ||
/// </summary> | ||
public interface IViewMapping : ITableMappingBase | ||
{ | ||
/// <summary> | ||
/// The target view. | ||
/// </summary> | ||
IView View { get; } | ||
|
||
/// <summary> | ||
/// The properties mapped to columns on the target view. | ||
/// </summary> | ||
new IEnumerable<IViewColumnMapping> ColumnMappings { get; } | ||
} | ||
} |
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.