Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SlimModel to RuntimeModel. #24766

Merged
merged 1 commit into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.InMemory.Diagnostics.Internal;
using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal;
using Microsoft.EntityFrameworkCore.InMemory.Internal;
using Microsoft.EntityFrameworkCore.InMemory.Metadata.Conventions;
using Microsoft.EntityFrameworkCore.InMemory.Query.Internal;
using Microsoft.EntityFrameworkCore.InMemory.Storage.Internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ public static OwnedNavigationBuilder<TEntity, TRelatedEntity> ToFunction<TEntity
var model = entityType.Model;
var function = name is not null
? model.FindDbFunction(name) ?? model.AddDbFunction(
name, typeof(IQueryable<>).MakeGenericType(entityType.ClrType ?? typeof(Dictionary<string, object>)))
name, typeof(IQueryable<>).MakeGenericType(entityType.ClrType))
: null;

return function;
Expand Down
18 changes: 8 additions & 10 deletions src/EFCore.Relational/Extensions/RelationalModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,7 @@ public static IEnumerable<IReadOnlySequence> GetSequences(this IReadOnlyModel mo
/// <param name="name"> The model name of the function. </param>
/// <returns> The function or <see langword="null" /> if the method is not mapped. </returns>
public static IReadOnlyDbFunction? FindDbFunction(this IReadOnlyModel model, string name)
=> DbFunction.FindDbFunction(
Check.NotNull(model, nameof(model)),
Check.NotNull(name, nameof(name)));
=> DbFunction.FindDbFunction(model, Check.NotNull(name, nameof(name)));

/// <summary>
/// Finds a function that is mapped to the method represented by the given name.
Expand All @@ -329,7 +327,7 @@ public static IEnumerable<IReadOnlySequence> GetSequences(this IReadOnlyModel mo
/// <param name="name"> The model name of the function. </param>
/// <returns> The function or <see langword="null" /> if the method is not mapped. </returns>
public static IMutableDbFunction? FindDbFunction(this IMutableModel model, string name)
=> (IMutableDbFunction?)((IModel)model).FindDbFunction(name);
=> (IMutableDbFunction?)((IReadOnlyModel)model).FindDbFunction(name);

/// <summary>
/// Finds a function that is mapped to the method represented by the given name.
Expand All @@ -338,7 +336,7 @@ public static IEnumerable<IReadOnlySequence> GetSequences(this IReadOnlyModel mo
/// <param name="name"> The model name of the function. </param>
/// <returns> The function or <see langword="null" /> if the method is not mapped. </returns>
public static IConventionDbFunction? FindDbFunction(this IConventionModel model, string name)
=> (IConventionDbFunction?)((IModel)model).FindDbFunction(name);
=> (IConventionDbFunction?)((IReadOnlyModel)model).FindDbFunction(name);

/// <summary>
/// Finds a function that is mapped to the method represented by the given name.
Expand Down Expand Up @@ -455,29 +453,29 @@ public static IConventionDbFunction AddDbFunction(
/// Returns all functions contained in the model.
/// </summary>
/// <param name="model"> The model to get the functions in. </param>
public static IEnumerable<IReadOnlyDbFunction> GetDbFunctions(this IModel model)
public static IEnumerable<IReadOnlyDbFunction> GetDbFunctions(this IReadOnlyModel model)
=> DbFunction.GetDbFunctions(Check.NotNull(model, nameof(model)));

/// <summary>
/// Returns all functions contained in the model.
/// </summary>
/// <param name="model"> The model to get the functions in. </param>
public static IEnumerable<IMutableDbFunction> GetDbFunctions(this IMutableModel model)
=> DbFunction.GetDbFunctions((Model)Check.NotNull(model, nameof(model))).Cast<IMutableDbFunction>();
=> DbFunction.GetDbFunctions(Check.NotNull(model, nameof(model))).Cast<IMutableDbFunction>();

/// <summary>
/// Returns all functions contained in the model.
/// </summary>
/// <param name="model"> The model to get the functions in. </param>
public static IEnumerable<IConventionDbFunction> GetDbFunctions(this IConventionModel model)
=> DbFunction.GetDbFunctions((Model)Check.NotNull(model, nameof(model))).Cast<IConventionDbFunction>();
=> DbFunction.GetDbFunctions(Check.NotNull(model, nameof(model))).Cast<IConventionDbFunction>();

/// <summary>
/// Returns all functions contained in the model.
/// </summary>
/// <param name="model"> The model to get the functions in. </param>
public static IEnumerable<IDbFunction> GetDbFunctions(this IReadOnlyModel model)
=> DbFunction.GetDbFunctions((Model)Check.NotNull(model, nameof(model)));
public static IEnumerable<IDbFunction> GetDbFunctions(this IModel model)
=> DbFunction.GetDbFunctions(Check.NotNull(model, nameof(model)));

/// <summary>
/// Returns the database collation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public override ConventionSet CreateConventionSet()

ReplaceConvention(
conventionSet.ModelFinalizedConventions,
(SlimModelConvention)new RelationalSlimModelConvention(Dependencies, RelationalDependencies));
(RuntimeModelConvention)new RelationalRuntimeModelConvention(Dependencies, RelationalDependencies));

return conventionSet;
}
Expand Down
Loading