-
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.
Part of #15662
- Loading branch information
Showing
15 changed files
with
108 additions
and
108 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 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
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,49 @@ | ||
// 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; | ||
using System.Collections.Generic; | ||
using System.Linq.Expressions; | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Utilities; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Defines how to create an entity instance through the binding of EF model properties to, for | ||
/// example, constructor parameters or parameters of a factory method. | ||
/// </summary> | ||
public abstract class InstantiationBinding | ||
{ | ||
/// <summary> | ||
/// Creates a new <see cref="InstantiationBinding" /> instance. | ||
/// </summary> | ||
/// <param name="parameterBindings"> The parameter bindings to use. </param> | ||
protected InstantiationBinding( | ||
[NotNull] IReadOnlyList<ParameterBinding> parameterBindings) | ||
{ | ||
Check.NotNull(parameterBindings, nameof(parameterBindings)); | ||
|
||
ParameterBindings = parameterBindings; | ||
} | ||
|
||
/// <summary> | ||
/// Creates an expression tree that represents creating an entity instance from the given binding | ||
/// information. For example, this might be a <see cref="NewExpression" /> to call a constructor, | ||
/// or a <see cref="MethodCallExpression" /> to call a factory method. | ||
/// </summary> | ||
/// <param name="bindingInfo"> Information needed to create the expression. </param> | ||
/// <returns> The expression tree. </returns> | ||
public abstract Expression CreateConstructorExpression(ParameterBindingInfo bindingInfo); | ||
|
||
/// <summary> | ||
/// The collection of <see cref="ParameterBinding" /> instances used. | ||
/// </summary> | ||
public virtual IReadOnlyList<ParameterBinding> ParameterBindings { get; } | ||
|
||
/// <summary> | ||
/// The type that will be created from the expression tree created for this binding. | ||
/// </summary> | ||
public abstract Type RuntimeType { 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
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.