Table of Contents

Class CoreStrings

Namespace
Microsoft.EntityFrameworkCore.Diagnostics
Assembly
Microsoft.EntityFrameworkCore.dll

String resources used in EF exceptions, etc.

These strings are exposed publicly for use by database providers and extensions. It is unusual for application code to need these strings.

public static class CoreStrings
Inheritance
CoreStrings
Inherited Members

Properties

CannotConvertQueryableToEnumerableMethod

Unable to convert a queryable method to an enumerable method. This is likely an issue in Entity Framework, please file an issue at https://go.microsoft.com/fwlink/?linkid=2142044.

public static string CannotConvertQueryableToEnumerableMethod { get; }

Property Value

string

ConcurrentMethodInvocation

A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.

public static string ConcurrentMethodInvocation { get; }

Property Value

string

ContextDisposed

Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.

public static string ContextDisposed { get; }

Property Value

string

ConventionsInfiniteLoop

The convention invocations have reached the recursion limit. This is likely an issue in Entity Framework, please file an issue at https://go.microsoft.com/fwlink/?linkid=2142044.

public static string ConventionsInfiniteLoop { get; }

Property Value

string

DataBindingToLocalWithIListSource

Data binding directly to 'DbSet.Local' is not supported since it does not provide a stable ordering. For WPF, bind to 'DbSet.Local.ToObservableCollection'. For WinForms, bind to 'DbSet.Local.ToBindingList'. For ASP.NET WebForms, bind to 'DbSet.ToList' or use Model Binding.

public static string DataBindingToLocalWithIListSource { get; }

Property Value

string

DataBindingWithIListSource

Data binding directly to a store query is not supported. Instead populate a DbSet with data, for example by calling 'Load' on the DbSet, and then bind to local data to avoid sending a query to the database each time the databound control iterates the data. For WPF, bind to 'DbSet.Local.ToObservableCollection'. For WinForms, bind to 'DbSet.Local.ToBindingList'. For ASP.NET WebForms, bind to 'DbSet.ToList' or use Model Binding.

public static string DataBindingWithIListSource { get; }

Property Value

string

DefaultMethodInvoked

The EF.Default<T> property may only be used within Entity Framework ExecuteUpdate method.

public static string DefaultMethodInvoked { get; }

Property Value

string

EFConstantInvoked

The EF.Constant<T> method may only be used within Entity Framework LINQ queries.

public static string EFConstantInvoked { get; }

Property Value

string

EFConstantWithNonEvaluableArgument

The EF.Constant<T> method may only be used with an argument that can be evaluated client-side and does not contain any reference to database-side entities.

public static string EFConstantWithNonEvaluableArgument { get; }

Property Value

string

EmptyJsonString

The empty string is not valid JSON.

public static string EmptyJsonString { get; }

Property Value

string

EnumerableResetNotSupported

This enumerator cannot be reset.

public static string EnumerableResetNotSupported { get; }

Property Value

string

ErrorInvalidQueryable

Cannot use multiple context instances within a single query execution. Ensure the query uses a single context instance.

public static string ErrorInvalidQueryable { get; }

Property Value

string

ExpressionParameterizationException

An exception was thrown while attempting to evaluate a LINQ query parameter expression. See the inner exception for more information. To show additional information call 'DbContextOptionsBuilder.EnableSensitiveDataLogging'.

public static string ExpressionParameterizationException { get; }

Property Value

string

HiLoBadBlockSize

The block size used for Hi-Lo value generation is not positive. The Hi-Lo generator is usually backed by a SQL sequence and this means that the sequence increment must be positive.

public static string HiLoBadBlockSize { get; }

Property Value

string

IQueryableProviderNotAsync

The provider for the source 'IQueryable' doesn't implement 'IAsyncQueryProvider'. Only providers that implement 'IAsyncQueryProvider' can be used for Entity Framework asynchronous operations.

public static string IQueryableProviderNotAsync { get; }

Property Value

string

IncompatibleSourcesForSetOperation

Incompatible sources used for set operation.

public static string IncompatibleSourcesForSetOperation { get; }

Property Value

string

InvalidDbContext

A previous error has left the DbContext in an invalid state. Applications should not continue to use a DbContext instance after an InvalidOperationException has been thrown.

public static string InvalidDbContext { get; }

Property Value

string

InvalidPoolSize

The specified poolSize must be greater than 0.

public static string InvalidPoolSize { get; }

Property Value

string

ModelMutable

Runtime metadata changes are not allowed when the model hasn't been marked as read-only.

public static string ModelMutable { get; }

Property Value

string

ModelReadOnly

Metadata changes are not allowed when the model has been marked as read-only.

public static string ModelReadOnly { get; }

Property Value

string

NativeAotNoCompiledModel

Model building is not supported when publishing with NativeAOT. Use a compiled model.

public static string NativeAotNoCompiledModel { get; }

Property Value

string

NoEfServices

Entity Framework services have not been added to the internal service provider. Either remove the call to 'UseInternalServiceProvider' so that Entity Framework will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. 'AddEntityFrameworkSqlServer').

public static string NoEfServices { get; }

Property Value

string

NoInterceptionResult

'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false.

public static string NoInterceptionResult { get; }

Property Value

string

NoProviderConfigured

No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

public static string NoProviderConfigured { get; }

Property Value

string

NotQueryingEnumerable

The given 'IQueryable' does not support generation of query strings.

public static string NotQueryingEnumerable { get; }

Property Value

string

ObjectRemovedFromModel

The object has been removed from the model.

public static string ObjectRemovedFromModel { get; }

Property Value

string

OwnedEntitiesCannotBeTrackedWithoutTheirOwner

A tracking query is attempting to project an owned entity without a corresponding owner in its result, but owned entities cannot be tracked without their owner. Either include the owner entity in the result or make the query non-tracking using 'AsNoTracking'.

public static string OwnedEntitiesCannotBeTrackedWithoutTheirOwner { get; }

Property Value

string

PoolingOptionsModified

'OnConfiguring' cannot be used to modify DbContextOptions when DbContext pooling is enabled.

public static string PoolingOptionsModified { get; }

Property Value

string

PropertyMethodInvoked

The EF.Property<T> method may only be used within Entity Framework LINQ queries.

public static string PropertyMethodInvoked { get; }

Property Value

string

QuerySelectContainsGrouping

Translation of 'Select' which contains grouping parameter without composition is not supported.

public static string QuerySelectContainsGrouping { get; }

Property Value

string

QueryUnableToTranslateStringEqualsWithStringComparison

Translation of the 'string.Equals' overload with a 'StringComparison' parameter is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information.

public static string QueryUnableToTranslateStringEqualsWithStringComparison { get; }

Property Value

string

RecursiveOnConfiguring

An attempt was made to use the context instance while it is being configured. A DbContext instance cannot be used inside 'OnConfiguring' since it is still being configured at this point. This can happen if a second operation is started on this context instance before a previous operation completed. Any instance members are not guaranteed to be thread safe.

public static string RecursiveOnConfiguring { get; }

Property Value

string

RecursiveOnModelCreating

An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside 'OnModelCreating' in any way that makes use of the model that is being created.

public static string RecursiveOnModelCreating { get; }

Property Value

string

RelationshipCannotBeInverted

The principal and dependent ends of the relationship cannot be changed once foreign key or principal key properties have been specified. Remove the conflicting configuration.

public static string RelationshipCannotBeInverted { get; }

Property Value

string

ResetNotSupported

'ObservableCollection<T>.Clear' is not supported because it uses the 'INotifyCollectionChanged' 'Reset' operation, which does not supply the items removed. Either use multiple calls to 'Remove', or use a notifying collection that supports 'Clear', such as 'Microsoft.EntityFrameworkCore.ChangeTracking.ObservableHashSet<T>'.

public static string ResetNotSupported { get; }

Property Value

string

RuntimeModelMissingData

The requested configuration is not stored in the read-optimized model, please use 'DbContext.GetService<IDesignTimeModel>().Model'.

public static string RuntimeModelMissingData { get; }

Property Value

string

RuntimeParameterMissingParameter

While registering a runtime parameter, the lambda expression must have only one parameter which must be same as 'QueryCompilationContext.QueryContextParameter' expression.

public static string RuntimeParameterMissingParameter { get; }

Property Value

string

SavepointsNotSupported

Savepoints are not supported by the database provider in use.

public static string SavepointsNotSupported { get; }

Property Value

string

SensitiveDataDisabled

To show additional information call 'DbContextOptionsBuilder.EnableSensitiveDataLogging'.

public static string SensitiveDataDisabled { get; }

Property Value

string

SequenceContainsMoreThanOneElement

Sequence contains more than one element.

public static string SequenceContainsMoreThanOneElement { get; }

Property Value

string

SequenceContainsNoElements

Sequence contains no elements.

public static string SequenceContainsNoElements { get; }

Property Value

string

SetOperationWithDifferentIncludesInOperands

Unable to translate set operation since both operands have different 'Include' operations. Consider having same 'Include' applied on both sides.

public static string SetOperationWithDifferentIncludesInOperands { get; }

Property Value

string

TransactionsNotSupported

The current provider doesn't support System.Transaction.

public static string TransactionsNotSupported { get; }

Property Value

string

Methods

AbstractLeafEntityType(object?)

The corresponding CLR type for entity type '{entityType}' cannot be instantiated, and there is no derived entity type in the model that corresponds to a concrete CLR type.

public static string AbstractLeafEntityType(object? entityType)

Parameters

entityType object

Returns

string

AddingProxyTypeAsEntityType(object?)

Cannot add type '{typeName}' to the model as it is a dynamically-generated proxy type.

public static string AddingProxyTypeAsEntityType(object? typeName)

Parameters

typeName object

Returns

string

AmbiguousDependentEntity(object?, object?)

The entity type '{entityType}' uses a shared type and the supplied entity is currently referenced from several owner entities. To access the entry for a particular reference, call '{targetEntryCall}' on the owner entry.

public static string AmbiguousDependentEntity(object? entityType, object? targetEntryCall)

Parameters

entityType object
targetEntryCall object

Returns

string

AmbiguousEndRequiredDependent(object?, object?)

The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be configured as having a required dependent since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See https://go.microsoft.com/fwlink/?LinkId=724062 for more details.

public static string AmbiguousEndRequiredDependent(object? foreignKeyProperties, object? entityType)

Parameters

foreignKeyProperties object
entityType object

Returns

string

AmbiguousEndRequiredDependentNavigation(object?, object?, object?)

The navigation '{entityType}.{navigation}' cannot be configured as required since the dependent side of the underlying foreign key {foreignKeyProperties} cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See https://go.microsoft.com/fwlink/?LinkId=724062 for more details.

public static string AmbiguousEndRequiredDependentNavigation(object? entityType, object? navigation, object? foreignKeyProperties)

Parameters

entityType object
navigation object
foreignKeyProperties object

Returns

string

AmbiguousEndRequiredInverted(object?, object?, object?)

The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be inverted to entity type '{principalEntityType}' since it was configured as required before the dependent side was configured. Configure the foreign key property or the principal key before configuring the foreign key as required. See https://go.microsoft.com/fwlink/?LinkId=724062 for more details.

public static string AmbiguousEndRequiredInverted(object? foreignKeyProperties, object? entityType, object? principalEntityType)

Parameters

foreignKeyProperties object
entityType object
principalEntityType object

Returns

string

AmbiguousForeignKeyPropertyCandidates(object?, object?, object?, object?, object?)

Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this, configure the foreign key properties explicitly in 'OnModelCreating' on at least one of the relationships.

public static string AmbiguousForeignKeyPropertyCandidates(object? firstDependentToPrincipalNavigationSpecification, object? firstPrincipalToDependentNavigationSpecification, object? secondDependentToPrincipalNavigationSpecification, object? secondPrincipalToDependentNavigationSpecification, object? foreignKeyProperties)

Parameters

firstDependentToPrincipalNavigationSpecification object
firstPrincipalToDependentNavigationSpecification object
secondDependentToPrincipalNavigationSpecification object
secondPrincipalToDependentNavigationSpecification object
foreignKeyProperties object

Returns

string

AmbiguousOneToOneRelationship(object?, object?)

The dependent side could not be determined for the one-to-one relationship between '{dependentToPrincipalNavigationSpecification}' and '{principalToDependentNavigationSpecification}'. To identify the dependent side of the relationship, configure the foreign key property. If these navigations should not be part of the same relationship, configure them independently via separate method chains in 'OnModelCreating'. See https://go.microsoft.com/fwlink/?LinkId=724062 for more details.

public static string AmbiguousOneToOneRelationship(object? dependentToPrincipalNavigationSpecification, object? principalToDependentNavigationSpecification)

Parameters

dependentToPrincipalNavigationSpecification object
principalToDependentNavigationSpecification object

Returns

string

AmbiguousOwnedNavigation(object?, object?)

Unable to determine the owner for the relationship between '{entityTypeNavigationSpecification}' and '{otherEntityType}' as both types have been marked as owned. Either manually configure the ownership, or ignore the corresponding navigations using the [NotMapped] attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string AmbiguousOwnedNavigation(object? entityTypeNavigationSpecification, object? otherEntityType)

Parameters

entityTypeNavigationSpecification object
otherEntityType object

Returns

string

AmbiguousSharedTypeEntityTypeName(object?)

The shared type entity type '{entityType}' cannot be added to the model because its name is the same as the CLR type name. This usually indicates an error, either add it as a non-shared entity type or choose a different name.

public static string AmbiguousSharedTypeEntityTypeName(object? entityType)

Parameters

entityType object

Returns

string

AnnotationNotFound(object?, object?)

The annotation '{annotation}' was not found. Ensure that the annotation has been added to the object {annotatable}

public static string AnnotationNotFound(object? annotation, object? annotatable)

Parameters

annotation object
annotatable object

Returns

string

ArgumentPropertyNull(object?, object?)

The property '{property}' of the argument '{argument}' cannot be null.

public static string ArgumentPropertyNull(object? property, object? argument)

Parameters

property object
argument object

Returns

string

AttributeNotOnEntityTypeProperty(object?, object?, object?)

The [{attribute}] attribute may only be specified on entity type properties. Remove the attribute from '{type}.{propertyName}'.

public static string AttributeNotOnEntityTypeProperty(object? attribute, object? type, object? propertyName)

Parameters

attribute object
type object
propertyName object

Returns

string

AutoIncludeNavigationCycle(object?)

Cycle detected while auto-including navigations: {cycleNavigations}. To fix this issue, either don't configure at least one navigation in the cycle as auto included in OnModelCreating or call 'IgnoreAutoInclude' method on the query.

public static string AutoIncludeNavigationCycle(object? cycleNavigations)

Parameters

cycleNavigations object

Returns

string

BackingFieldOnIndexer(object?, object?, object?)

Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Ensure no backing fields are specified for indexer properties.

public static string BackingFieldOnIndexer(object? field, object? entityType, object? property)

Parameters

field object
entityType object
property object

Returns

string

BadBackingFieldType(object?, object?, object?, object?, object?)

The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are compatible with the property type can be used.

public static string BadBackingFieldType(object? field, object? fieldType, object? entityType, object? property, object? propertyType)

Parameters

field object
fieldType object
entityType object
property object
propertyType object

Returns

string

BadDependencyRegistration(object?)

The service dependencies type '{dependenciesType}' has been registered incorrectly in the service collection. Service dependencies types must only be registered by Entity Framework or database providers.

public static string BadDependencyRegistration(object? dependenciesType)

Parameters

dependenciesType object

Returns

string

BadEnumValue(object?, object?)

The value '{enumValue}' could not be parsed as a value of enum {enumType}.

public static string BadEnumValue(object? enumValue, object? enumType)

Parameters

enumValue object
enumType object

Returns

string

BadFilterDerivedType(object?, object?, object?)

The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type '{rootType}'.

public static string BadFilterDerivedType(object? filter, object? entityType, object? rootType)

Parameters

filter object
entityType object
rootType object

Returns

string

BadFilterExpression(object?, object?, object?)

The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}' and return bool.

public static string BadFilterExpression(object? filter, object? entityType, object? clrType)

Parameters

filter object
entityType object
clrType object

Returns

string

BadFilterOwnedType(object?, object?)

The filter expression '{filter}' cannot be specified for owned entity type '{entityType}'. A filter may only be applied to an entity type that is not owned. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string BadFilterOwnedType(object? filter, object? entityType)

Parameters

filter object
entityType object

Returns

string

BadJsonValueReaderWriterType(object?)

The type '{givenType}' cannot be used as a 'JsonValueReaderWriter' because it does not inherit from the generic 'JsonValueReaderWriter<TValue>'. Make sure to inherit json reader/writers from 'JsonValueReaderWriter<TValue>'.

public static string BadJsonValueReaderWriterType(object? givenType)

Parameters

givenType object

Returns

string

BadListType(object?, object?)

The type '{givenType}' cannot be used as a primitive collection because it is not an array and does not implement '{listType}'. Collections of primitive types must be arrays or ordered lists.

public static string BadListType(object? givenType, object? listType)

Parameters

givenType object
listType object

Returns

string

BadValueComparerType(object?, object?)

The type '{givenType}' cannot be used as a value comparer because it does not inherit from '{expectedType}'. Make sure to inherit value comparers from '{expectedType}'.

public static string BadValueComparerType(object? givenType, object? expectedType)

Parameters

givenType object
expectedType object

Returns

string

BadValueConverterType(object?, object?)

The type '{givenType}' cannot be used as a value converter because it does not inherit from '{expectedType}'. Make sure to inherit value converters from '{expectedType}'.

public static string BadValueConverterType(object? givenType, object? expectedType)

Parameters

givenType object
expectedType object

Returns

string

BadValueGeneratorType(object?, object?)

The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'. Make sure to inherit value generators from '{expectedType}'.

public static string BadValueGeneratorType(object? givenType, object? expectedType)

Parameters

givenType object
expectedType object

Returns

string

CanOnlyConfigureExistingNavigations(object?, object?)

Navigation '{1_entityType}.{0_navigationName}' was not found. Please add the navigation to the entity type before configuring it.

public static string CanOnlyConfigureExistingNavigations(object? navigationName, object? entityType)

Parameters

navigationName object
entityType object

Returns

string

CannotBeNullable(object?, object?, object?)

The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types can be marked as nullable/optional.

public static string CannotBeNullable(object? property, object? entityType, object? propertyType)

Parameters

property object
entityType object
propertyType object

Returns

string

CannotBeNullableElement(object?, object?, object?)

The element type of property '{entityType}.{property}' cannot be marked as nullable/optional because the type of the element is '{elementType}' which is not a nullable type. Any element type can be marked as non-nullable/required, but only elements of nullable types can be marked as nullable/optional.

public static string CannotBeNullableElement(object? entityType, object? property, object? elementType)

Parameters

entityType object
property object
elementType object

Returns

string

CannotBeNullablePK(object?, object?)

The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional.

public static string CannotBeNullablePK(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

CannotConvertEnumValue(object?, object?)

Cannot convert string value '{value}' from the database to any value in the mapped '{enumType}' enum.

public static string CannotConvertEnumValue(object? value, object? enumType)

Parameters

value object
enumType object

Returns

string

CannotCreateJsonValueReaderWriter(object?)

Cannot create an instance of reade/writer type '{readerWriterType}'. Ensure that the type can be instantiated and has a public parameterless constructor, or has a public static 'Instance' field returning the singleton instance to use.

public static string CannotCreateJsonValueReaderWriter(object? readerWriterType)

Parameters

readerWriterType object

Returns

string

CannotCreateValueComparer(object?, object?)

Cannot create an instance of value comparer type '{generatorType}'. Ensure that the type can be instantiated and has a parameterless constructor, or use the overload of '{method}' that accepts a delegate.

public static string CannotCreateValueComparer(object? generatorType, object? method)

Parameters

generatorType object
method object

Returns

string

CannotCreateValueConverter(object?, object?)

Cannot create an instance of value converter type '{generatorType}'. Ensure that the type can be instantiated and has a parameterless constructor, or use the overload of '{method}' that accepts a delegate.

public static string CannotCreateValueConverter(object? generatorType, object? method)

Parameters

generatorType object
method object

Returns

string

CannotCreateValueGenerator(object?, object?)

Cannot create an instance of value generator type '{generatorType}'. Ensure that the type can be instantiated and has a parameterless constructor, or use the overload of '{method}' that accepts a delegate.

public static string CannotCreateValueGenerator(object? generatorType, object? method)

Parameters

generatorType object
method object

Returns

string

CannotLoadDetachedShadow(object?, object?)

The navigation '{1_entityType}.{0_navigation}' cannot be loaded because one or more of the key or foreign key properties are shadow properties and the entity is not being tracked. Relationships using shadow values can only be loaded for tracked entities.

public static string CannotLoadDetachedShadow(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

CannotMarkNonShared(object?)

The type '{type}' cannot be marked as a non-shared type since a shared type entity type with this CLR type exists in the model.

public static string CannotMarkNonShared(object? type)

Parameters

type object

Returns

string

CannotMarkShared(object?)

The type '{type}' cannot be marked as a shared type since an entity type with the same CLR type already exists in the model.

public static string CannotMarkShared(object? type)

Parameters

type object

Returns

string

CannotMaterializeAbstractType(object?)

Unable to create an instance of entity type '{entityType}' because it is abstract. Consider making make it non-abstract or mapping at least one derived type.

public static string CannotMaterializeAbstractType(object? entityType)

Parameters

entityType object

Returns

string

ChangeTrackingInterfaceMissing(object?, object?, object?)

The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy, but does not implement the required '{notificationInterface}' interface. Implement '{notificationInterface}' on '{entityType}' or use a different change tracking strategy.

public static string ChangeTrackingInterfaceMissing(object? entityType, object? changeTrackingStrategy, object? notificationInterface)

Parameters

entityType object
changeTrackingStrategy object
notificationInterface object

Returns

string

CircularDependency(object?)

Unable to save changes because a circular dependency was detected in the data to be saved: '{cycle}'.

public static string CircularDependency(object? cycle)

Parameters

cycle object

Returns

string

CircularInheritance(object?, object?)

The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'. Review your model configuration.

public static string CircularInheritance(object? entityType, object? baseEntityType)

Parameters

entityType object
baseEntityType object

Returns

string

ClashingMismatchedSharedType(object?, object?)

The shared-type entity type '{entityType}' cannot be added because the model already contains an entity type with the same name, but with a different CLR type '{otherClrType}'. Ensure all entity type names are unique.

public static string ClashingMismatchedSharedType(object? entityType, object? otherClrType)

Parameters

entityType object
otherClrType object

Returns

string

ClashingNamedOwnedType(object?, object?, object?)

An entity type named '{ownedTypeName}' has already been added to the model. Use a different name when configuring the ownership '{ownerEntityType}.{navigation}' in 'OnModelCreating'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string ClashingNamedOwnedType(object? ownedTypeName, object? ownerEntityType, object? navigation)

Parameters

ownedTypeName object
ownerEntityType object
navigation object

Returns

string

ClashingNonOwnedDerivedEntityType(object?, object?)

The entity type '{entityType}' cannot be marked as owned because the derived entity type '{derivedType}' has been configured as non-owned. Either don't configure '{derivedType}' as non-owned, or call 'HasBaseType(null)' for it in 'OnModelCreating'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string ClashingNonOwnedDerivedEntityType(object? entityType, object? derivedType)

Parameters

entityType object
derivedType object

Returns

string

ClashingNonOwnedEntityType(object?)

The entity type '{entityType}' cannot be configured as owned because it has already been configured as a non-owned. If you want to override previous configuration first remove the entity type from the model by calling 'Ignore'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string ClashingNonOwnedEntityType(object? entityType)

Parameters

entityType object

Returns

string

ClashingNonSharedType(object?, object?)

The shared-type entity type '{entityType}' with CLR type '{type}' cannot be added to the model because a non-shared entity type with the same CLR type already exists.

public static string ClashingNonSharedType(object? entityType, object? type)

Parameters

entityType object
type object

Returns

string

ClashingOwnedDerivedEntityType(object?, object?)

The entity type '{entityType}' cannot be marked as non-owned because the derived entity type '{derivedType}' has been configured as owned. Either don't configure '{derivedType}' as owned, or call 'HasBaseType(null)' for it in 'OnModelCreating'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string ClashingOwnedDerivedEntityType(object? entityType, object? derivedType)

Parameters

entityType object
derivedType object

Returns

string

ClashingOwnedEntityType(object?)

The entity type '{entityType}' cannot be configured as non-owned because it has already been configured as a owned. Use the nested builder in OwnsOne or OwnsMany on the owner entity type builder to further configure this type. If you want to override previous configuration first remove the entity type from the model by calling 'Ignore'. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string ClashingOwnedEntityType(object? entityType)

Parameters

entityType object

Returns

string

ClashingSharedType(object?)

The entity type '{entityType}' cannot be added to the model because its CLR type has been configured as a shared type.

public static string ClashingSharedType(object? entityType)

Parameters

entityType object

Returns

string

ClientProjectionCapturingConstantInMethodArgument(object?, object?)

The client projection contains a reference to a constant expression of '{constantType}' which is being passed as an argument to the method '{methodName}'. This could potentially cause a memory leak; consider assigning this constant to a local variable and using the variable in the query instead. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information and examples.

public static string ClientProjectionCapturingConstantInMethodArgument(object? constantType, object? methodName)

Parameters

constantType object
methodName object

Returns

string

ClientProjectionCapturingConstantInMethodInstance(object?, object?)

The client projection contains a reference to a constant expression of '{constantType}' through the instance method '{methodName}'. This could potentially cause a memory leak; consider making the method static so that it does not capture constant in the instance. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information and examples.

public static string ClientProjectionCapturingConstantInMethodInstance(object? constantType, object? methodName)

Parameters

constantType object
methodName object

Returns

string

ClientProjectionCapturingConstantInTree(object?)

The client projection contains a reference to a constant expression of '{constantType}'. This could potentially cause a memory leak; consider assigning this constant to a local variable and using the variable in the query instead. See https://go.microsoft.com/fwlink/?linkid=2103067 for more information and examples.

public static string ClientProjectionCapturingConstantInTree(object? constantType)

Parameters

constantType object

Returns

string

CollectionIsReference(object?, object?, object?, object?)

The property '{1_entityType}.{0_property}' is being accessed using '{collectionMethod}', but is defined in the model as a non-collection, reference navigation. Use '{referenceMethod}' to access reference navigations.

public static string CollectionIsReference(object? property, object? entityType, object? collectionMethod, object? referenceMethod)

Parameters

property object
entityType object
collectionMethod object
referenceMethod object

Returns

string

ComparerPropertyMismatch(object?, object?, object?, object?)

The comparer for type '{type}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'.

public static string ComparerPropertyMismatch(object? type, object? entityType, object? propertyName, object? propertyType)

Parameters

type object
entityType object
propertyName object
propertyType object

Returns

string

ComparerPropertyMismatchElement(object?, object?, object?, object?)

The comparer for element type '{type}' cannot be used for '{entityType}.{propertyName}' because its element type is '{elementType}'.

public static string ComparerPropertyMismatchElement(object? type, object? entityType, object? propertyName, object? elementType)

Parameters

type object
entityType object
propertyName object
elementType object

Returns

string

CompiledModelIncompatibleTypeMapping(object?)

The type mapping used is incompatible with a compiled model. The mapping type must have a 'public static readonly {typeMapping} {typeMapping}.Default' property.

public static string CompiledModelIncompatibleTypeMapping(object? typeMapping)

Parameters

typeMapping object

Returns

string

CompiledQueryDifferentModel(object?)

The compiled query '{queryExpression}' was executed with a different model than it was compiled against. Compiled queries can only be used with a single model.

public static string CompiledQueryDifferentModel(object? queryExpression)

Parameters

queryExpression object

Returns

string

ComplexCollectionWrongClrType(object?, object?, object?, object?)

The collection complex property '{property}' cannot be added to the type '{type}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection complex property must implement IEnumerable<> of the complex type.

public static string ComplexCollectionWrongClrType(object? property, object? type, object? clrType, object? targetType)

Parameters

property object
type object
clrType object
targetType object

Returns

string

ComplexPropertyCollection(object?, object?)

Adding the collection complex property '{type}.{property}' isn't supported. See https://github.com/dotnet/efcore/issues/31237 for more information.

public static string ComplexPropertyCollection(object? type, object? property)

Parameters

type object
property object

Returns

string

ComplexPropertyIndexer(object?, object?)

Adding the complex property '{type}.{property}' as an indexer property isn't supported. See https://github.com/dotnet/efcore/issues/31244 for more information.

public static string ComplexPropertyIndexer(object? type, object? property)

Parameters

type object
property object

Returns

string

ComplexPropertyNotFound(object?, object?)

The complex property '{type}.{property}' could not be found. Ensure that the property exists and has been included in the model as a complex property.

public static string ComplexPropertyNotFound(object? type, object? property)

Parameters

type object
property object

Returns

string

ComplexPropertyOptional(object?, object?)

Configuring the complex property '{type}.{property}' as optional is not supported, call 'IsRequired()'. See https://github.com/dotnet/efcore/issues/31376 for more information.

public static string ComplexPropertyOptional(object? type, object? property)

Parameters

type object
property object

Returns

string

ComplexPropertyShadow(object?, object?)

Configuring the complex property '{type}.{property}' in shadow state isn't supported. See https://github.com/dotnet/efcore/issues/31243 for more information.

public static string ComplexPropertyShadow(object? type, object? property)

Parameters

type object
property object

Returns

string

ComplexPropertyWrongClrType(object?, object?, object?, object?)

The complex property '{property}' cannot be added to the type '{type}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'.

public static string ComplexPropertyWrongClrType(object? property, object? type, object? clrType, object? targetType)

Parameters

property object
type object
clrType object
targetType object

Returns

string

ComplexTypesNotSupported(object?)

'{service}' doesn't currently support complex types.

public static string ComplexTypesNotSupported(object? service)

Parameters

service object

Returns

string

CompositeFkOnProperty(object?, object?)

There are multiple properties with the [ForeignKey] attribute pointing to navigation '{1_entityType}.{0_navigation}'. To define a composite foreign key using data annotations, use the [ForeignKey] attribute on the navigation.

public static string CompositeFkOnProperty(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

CompositePKWithDataAnnotation(object?)

The entity type '{entityType}' has multiple properties with the [Key] attribute. Composite primary keys configured by placing the [PrimaryKey] attribute on the entity type class, or by using 'HasKey' in 'OnModelCreating'.

public static string CompositePKWithDataAnnotation(object? entityType)

Parameters

entityType object

Returns

string

ConflictingBackingFields(object?, object?, object?, object?)

Property '{1_entityType}.{0_property}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with 'HasField' in 'OnModelCreating'.

public static string ConflictingBackingFields(object? property, object? entityType, object? field1, object? field2)

Parameters

property object
entityType object
field1 object
field2 object

Returns

string

ConflictingFieldProperty(object?, object?, object?, object?, object?)

The member '{type}.{property}' cannot use field '{field}' because it is already used by '{conflictingType}.{conflictingProperty}'.

public static string ConflictingFieldProperty(object? type, object? property, object? field, object? conflictingType, object? conflictingProperty)

Parameters

type object
property object
field object
conflictingType object
conflictingProperty object

Returns

string

ConflictingForeignKeyAttributes(object?, object?, object?)

There are multiple [ForeignKey] attributes which are pointing to same set of properties '{propertyList}' on entity type '{entityType}' and targeting the principal entity type '{principalEntityType}'.

public static string ConflictingForeignKeyAttributes(object? propertyList, object? entityType, object? principalEntityType)

Parameters

propertyList object
entityType object
principalEntityType object

Returns

string

ConflictingKeylessAndPrimaryKeyAttributes(object?)

The entity type '{entity}' has both [Keyless] and [PrimaryKey] attributes; one must be removed.

public static string ConflictingKeylessAndPrimaryKeyAttributes(object? entity)

Parameters

entity object

Returns

string

ConflictingPropertyOrNavigation(object?, object?, object?)

The property or navigation '{member}' cannot be added to the '{type}' type because a property or navigation with the same name already exists on the '{conflictingType}' type.

public static string ConflictingPropertyOrNavigation(object? member, object? type, object? conflictingType)

Parameters

member object
type object
conflictingType object

Returns

string

ConflictingRelationshipConversions(object?, object?, object?, object?)

The property '{entityType}.{property}' participates in several relationship chains that have conflicting conversions: '{valueConversion}' and '{conflictingValueConversion}'.

public static string ConflictingRelationshipConversions(object? entityType, object? property, object? valueConversion, object? conflictingValueConversion)

Parameters

entityType object
property object
valueConversion object
conflictingValueConversion object

Returns

string

ConflictingRelationshipNavigation(object?, object?, object?, object?)

Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}' because a relationship already exists between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigations can only participate in a single relationship. If you want to override an existing relationship call 'Ignore' on the navigation '{newDependentNavigationSpecification}' first in 'OnModelCreating'.

public static string ConflictingRelationshipNavigation(object? newPrincipalNavigationSpecification, object? newDependentNavigationSpecification, object? existingPrincipalNavigationSpecification, object? existingDependentNavigationSpecification)

Parameters

newPrincipalNavigationSpecification object
newDependentNavigationSpecification object
existingPrincipalNavigationSpecification object
existingDependentNavigationSpecification object

Returns

string

ConstructorBindingFailed(object?, object?)

Cannot bind '{failedBinds}' in '{parameters}'

public static string ConstructorBindingFailed(object? failedBinds, object? parameters)

Parameters

failedBinds object
parameters object

Returns

string

ConstructorConflict(object?, object?)

The constructors '{firstConstructor}' and '{secondConstructor}' have the same number of parameters, and can both be used by Entity Framework. The constructor to be used must be configured in 'OnModelCreating'.

public static string ConstructorConflict(object? firstConstructor, object? secondConstructor)

Parameters

firstConstructor object
secondConstructor object

Returns

string

ConstructorNotFound(object?, object?)

No suitable constructor was found for entity type '{entityType}'. The following constructors had parameters that could not be bound to properties of the entity type: {constructors}Note that only mapped properties can be bound to constructor parameters. Navigations to related entities, including references to owned types, cannot be bound.

public static string ConstructorNotFound(object? entityType, object? constructors)

Parameters

entityType object
constructors object

Returns

string

ConverterBadType(object?, object?, object?)

The value converter '{converter}' cannot be used with type '{type}'. This converter can only be used with {allowed}.

public static string ConverterBadType(object? converter, object? type, object? allowed)

Parameters

converter object
type object
allowed object

Returns

string

ConverterPropertyMismatch(object?, object?, object?, object?)

Converter for model type '{converterType}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'.

public static string ConverterPropertyMismatch(object? converterType, object? entityType, object? propertyName, object? propertyType)

Parameters

converterType object
entityType object
propertyName object
propertyType object

Returns

string

ConverterPropertyMismatchElement(object?, object?, object?, object?)

Converter for element type '{converterType}' cannot be used for '{entityType}.{propertyName}' because its element type is '{elementType}'.

public static string ConverterPropertyMismatchElement(object? converterType, object? entityType, object? propertyName, object? elementType)

Parameters

converterType object
entityType object
propertyName object
elementType object

Returns

string

ConvertersCannotBeComposed(object?, object?, object?, object?)

Cannot compose converter from '{typeOneIn}' to '{typeOneOut}' with converter from '{typeTwoIn}' to '{typeTwoOut}' because the output type of the first converter doesn't match the input type of the second converter.

public static string ConvertersCannotBeComposed(object? typeOneIn, object? typeOneOut, object? typeTwoIn, object? typeTwoOut)

Parameters

typeOneIn object
typeOneOut object
typeTwoIn object
typeTwoOut object

Returns

string

DbContextMissingConstructor(object?)

'AddDbContext' was called with configuration, but the context type '{contextType}' only declares a parameterless constructor. This means that the configuration passed to 'AddDbContext' will never be used. If configuration is passed to 'AddDbContext', then '{contextType}' should declare a constructor that accepts a DbContextOptions<{contextType}> and must pass it to the base constructor for DbContext.

public static string DbContextMissingConstructor(object? contextType)

Parameters

contextType object

Returns

string

DbSetIncorrectGenericType(object?, object?, object?)

Cannot create DbSet for entity type '{entityType}' since it is of type '{entityClrType}' but the generic type provided is of type '{genericType}'.

public static string DbSetIncorrectGenericType(object? entityType, object? entityClrType, object? genericType)

Parameters

entityType object
entityClrType object
genericType object

Returns

string

DebugViewError(object?)

Debug view threw {message}. Please report this at https://github.com/dotnet/efcore

public static string DebugViewError(object? message)

Parameters

message object

Returns

string

DebugViewQueryExpressionError(object?)

Error creating query expression: {message}.

public static string DebugViewQueryExpressionError(object? message)

Parameters

message object

Returns

string

DebugViewQueryStringError(object?)

Error creating query string: {message}.

public static string DebugViewQueryStringError(object? message)

Parameters

message object

Returns

string

DeleteBehaviorAttributeNotOnNavigationProperty(object?, object?)

The [DeleteBehavior] attribute may only be specified on navigation properties, and is not supported on properties making up the foreign key. Remove the attribute from '{type}.{propertyName}'.

public static string DeleteBehaviorAttributeNotOnNavigationProperty(object? type, object? propertyName)

Parameters

type object
propertyName object

Returns

string

DeleteBehaviorAttributeOnPrincipalProperty(object?, object?)

The [DeleteBehavior] attribute may only be specified on the dependent side of the relationship. Remove the attribute from '{entityType}.{navigationName}'.

public static string DeleteBehaviorAttributeOnPrincipalProperty(object? entityType, object? navigationName)

Parameters

entityType object
navigationName object

Returns

string

DependentEntityTypeNotInRelationship(object?, object?, object?)

You are configuring a relationship between '{dependentEntityType}' and '{principalEntityType}' but have specified a foreign key on '{entityType}'. The foreign key must be defined on a type that is part of the relationship.

public static string DependentEntityTypeNotInRelationship(object? dependentEntityType, object? principalEntityType, object? entityType)

Parameters

dependentEntityType object
principalEntityType object
entityType object

Returns

string

DerivedEntityCannotBeKeyless(object?)

Unable to set a base type for entity type '{entityType}' because it has been configured as keyless. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string DerivedEntityCannotBeKeyless(object? entityType)

Parameters

entityType object

Returns

string

DerivedEntityCannotHaveKeys(object?)

Unable to set a base type for entity type '{entityType}' because it has one or more keys defined. Only root types can have keys.

public static string DerivedEntityCannotHaveKeys(object? entityType)

Parameters

entityType object

Returns

string

DerivedEntityOwnershipMismatch(object?, object?, object?, object?)

Unable to set '{baseEntityType}' as the base type for entity type '{derivedEntityType}' because '{ownedEntityType}' is configured as owned, while '{nonOwnedEntityType}' is non-owned. All entity types in a hierarchy need to have the same ownership status. See https://aka.ms/efcore-docs-owned for more information and examples.

public static string DerivedEntityOwnershipMismatch(object? baseEntityType, object? derivedEntityType, object? ownedEntityType, object? nonOwnedEntityType)

Parameters

baseEntityType object
derivedEntityType object
ownedEntityType object
nonOwnedEntityType object

Returns

string

DerivedEntityTypeHasNoKey(object?, object?)

'{derivedType}' cannot be configured as keyless because it is a derived type; the root type '{rootType}' must be configured as keyless instead. If you did not intend for '{rootType}' to be included in the model, ensure that it is not referenced by a DbSet property on your context, referenced in a configuration call to ModelBuilder in 'OnModelCreating', or referenced from a navigation on a type that is included in the model. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string DerivedEntityTypeHasNoKey(object? derivedType, object? rootType)

Parameters

derivedType object
rootType object

Returns

string

DerivedEntityTypeKey(object?, object?)

A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not referenced by a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation on a type that is included in the model.

public static string DerivedEntityTypeKey(object? derivedType, object? rootType)

Parameters

derivedType object
rootType object

Returns

string

DerivedTypeDefiningQuery(object?, object?)

The entity type '{entityType}' cannot have a defining query because it is derived from '{baseType}'. Only base entity types can have a defining query.

public static string DerivedTypeDefiningQuery(object? entityType, object? baseType)

Parameters

entityType object
baseType object

Returns

string

DiscriminatorEntityTypeNotDerived(object?, object?)

Cannot configure the discriminator value for entity type '{entityType}' because it doesn't derive from '{rootEntityType}'.

public static string DiscriminatorEntityTypeNotDerived(object? entityType, object? rootEntityType)

Parameters

entityType object
rootEntityType object

Returns

string

DiscriminatorPropertyMustBeOnRoot(object?)

A discriminator property cannot be set for the entity type '{entityType}' because it is not the root of an inheritance hierarchy.

public static string DiscriminatorPropertyMustBeOnRoot(object? entityType)

Parameters

entityType object

Returns

string

DiscriminatorPropertyNotFound(object?, object?)

Unable to set property '{property}' as a discriminator for entity type '{entityType}' because it is not a property of '{entityType}'.

public static string DiscriminatorPropertyNotFound(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

DiscriminatorValueIncompatible(object?, object?, object?)

The discriminator value '{value}' for the entity type '{entityType}' cannot be set because it is not assignable to the discriminator property of type '{discriminatorType}'.

public static string DiscriminatorValueIncompatible(object? value, object? entityType, object? discriminatorType)

Parameters

value object
entityType object
discriminatorType object

Returns

string

DuplicateAnnotation(object?, object?)

The annotation '{annotation}' cannot be added because an annotation with the same name already exists on the object {annotatable}

public static string DuplicateAnnotation(object? annotation, object? annotatable)

Parameters

annotation object
annotatable object

Returns

string

DuplicateComplexType(object?)

The complex type '{complexType}' cannot be added to the model because a complex type with the same name already exists.

public static string DuplicateComplexType(object? complexType)

Parameters

complexType object

Returns

string

DuplicateDiscriminatorValue(object?, object?, object?)

The discriminator value for '{entityType1}' is '{discriminatorValue}' which is the same for '{entityType2}'. Every concrete entity type in the hierarchy must have a unique discriminator value.

public static string DuplicateDiscriminatorValue(object? entityType1, object? discriminatorValue, object? entityType2)

Parameters

entityType1 object
discriminatorValue object
entityType2 object

Returns

string

DuplicateEntityType(object?)

The entity type '{entityType}' cannot be added to the model because an entity type with the same name already exists.

public static string DuplicateEntityType(object? entityType)

Parameters

entityType object

Returns

string

DuplicateForeignKey(object?, object?, object?, object?, object?)

The foreign key {foreignKeyProperties} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {keyProperties} on '{principalType}'.

public static string DuplicateForeignKey(object? foreignKeyProperties, object? entityType, object? duplicateEntityType, object? keyProperties, object? principalType)

Parameters

foreignKeyProperties object
entityType object
duplicateEntityType object
keyProperties object
principalType object

Returns

string

DuplicateIndex(object?, object?, object?)

The index {indexProperties} cannot be added to the entity type '{entityType}' because an unnamed index on the same properties already exists on entity type '{duplicateEntityType}'. Consider adding a name for one of the indexes in 'OnModelCreating'.

public static string DuplicateIndex(object? indexProperties, object? entityType, object? duplicateEntityType)

Parameters

indexProperties object
entityType object
duplicateEntityType object

Returns

string

DuplicateKey(object?, object?, object?)

The key {keyProperties} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'.

public static string DuplicateKey(object? keyProperties, object? entityType, object? duplicateEntityType)

Parameters

keyProperties object
entityType object
duplicateEntityType object

Returns

string

DuplicateNamedIndex(object?, object?, object?, object?)

The index named '{indexName}' defined on properties {indexProperties} cannot be added to the entity type '{entityType}' because an index with the same name already exists on entity type '{duplicateEntityType}'.

public static string DuplicateNamedIndex(object? indexName, object? indexProperties, object? entityType, object? duplicateEntityType)

Parameters

indexName object
indexProperties object
entityType object
duplicateEntityType object

Returns

string

DuplicatePropertiesOnBase(object?, object?, object?, object?, object?, object?)

The type '{entityType}' cannot have base type '{baseType}' because the properties '{derivedPropertyType}.{derivedProperty}' and '{basePropertyType}.{baseProperty}' are in conflict.

public static string DuplicatePropertiesOnBase(object? entityType, object? baseType, object? derivedPropertyType, object? derivedProperty, object? basePropertyType, object? baseProperty)

Parameters

entityType object
baseType object
derivedPropertyType object
derivedProperty object
basePropertyType object
baseProperty object

Returns

string

DuplicatePropertyInForeignKey(object?, object?)

The properties {propertyList} cannot be used for a foreign key, because they contain a duplicate: '{property}'.

public static string DuplicatePropertyInForeignKey(object? propertyList, object? property)

Parameters

propertyList object
property object

Returns

string

DuplicatePropertyInIndex(object?, object?)

The properties {propertyList} cannot be used for an index, because they contain a duplicate: '{property}'.

public static string DuplicatePropertyInIndex(object? propertyList, object? property)

Parameters

propertyList object
property object

Returns

string

DuplicatePropertyInKey(object?, object?)

The properties {propertyList} cannot be used for a key, because they contain a duplicate: '{property}'.

public static string DuplicatePropertyInKey(object? propertyList, object? property)

Parameters

propertyList object
property object

Returns

string

DuplicateTrigger(object?, object?, object?)

The trigger '{trigger}' cannot be added to the entity type '{entityType}' because another trigger with the same name already exists on entity type '{conflictingEntityType}'.

public static string DuplicateTrigger(object? trigger, object? entityType, object? conflictingEntityType)

Parameters

trigger object
entityType object
conflictingEntityType object

Returns

string

EmptyComplexType(object?)

Complex type '{complexType}' has no properties defines. Configure at least one property or don't include this type in the model.

public static string EmptyComplexType(object? complexType)

Parameters

complexType object

Returns

string

EntityEqualityOnCompositeKeyEntitySubqueryNotSupported(object?, object?)

Cannot translate '{comparisonOperator}' on a subquery expression of entity type '{entityType}' because it has a composite primary key. See https://go.microsoft.com/fwlink/?linkid=2141942 for information on how to rewrite your query.

public static string EntityEqualityOnCompositeKeyEntitySubqueryNotSupported(object? comparisonOperator, object? entityType)

Parameters

comparisonOperator object
entityType object

Returns

string

EntityEqualityOnKeylessEntityNotSupported(object?, object?)

Cannot translate the '{comparisonOperator}' on an expression of entity type '{entityType}' because it is a keyless entity. Consider using entity properties instead. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string EntityEqualityOnKeylessEntityNotSupported(object? comparisonOperator, object? entityType)

Parameters

comparisonOperator object
entityType object

Returns

string

EntityRequiresKey(object?)

The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string EntityRequiresKey(object? entityType)

Parameters

entityType object

Returns

string

EntityTypeInUseByDerived(object?, object?)

The entity type '{entityType}' cannot be removed because '{derivedEntityType}' is derived from it. Before the entity type can be removed, all derived entity types must be removed or configured to use a different base entity type.

public static string EntityTypeInUseByDerived(object? entityType, object? derivedEntityType)

Parameters

entityType object
derivedEntityType object

Returns

string

EntityTypeInUseByReferencingForeignKey(object?, object?, object?)

The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKeyProperties} on '{referencingEntityType}'. Before the entity type can be removed, all referencing foreign keys must be removed.

public static string EntityTypeInUseByReferencingForeignKey(object? entityType, object? foreignKeyProperties, object? referencingEntityType)

Parameters

entityType object
foreignKeyProperties object
referencingEntityType object

Returns

string

EntityTypeInUseByReferencingSkipNavigation(object?, object?, object?)

The entity type '{entityType}' cannot be removed because it is being referenced by the skip navigation '{skipNavigation}' on '{referencingEntityType}'. Before the entity type can be removed, all referencing skip navigations must be removed.

public static string EntityTypeInUseByReferencingSkipNavigation(object? entityType, object? skipNavigation, object? referencingEntityType)

Parameters

entityType object
skipNavigation object
referencingEntityType object

Returns

string

EntityTypeModelMismatch(object?, object?)

The entity types '{firstEntityType}' and '{secondEntityType}' do not belong to the same model.

public static string EntityTypeModelMismatch(object? firstEntityType, object? secondEntityType)

Parameters

firstEntityType object
secondEntityType object

Returns

string

EntityTypeNotFound(object?)

The entity type '{entityType}' was not found. Ensure that the entity type has been added to the model.

public static string EntityTypeNotFound(object? entityType)

Parameters

entityType object

Returns

string

EntityTypeNotInRelationship(object?, object?, object?)

The specified entity type '{entityType}' is invalid. It must be the dependent entity type '{dependentType}', the principal entity type '{principalType}' or an entity type derived from one of them.

public static string EntityTypeNotInRelationship(object? entityType, object? dependentType, object? principalType)

Parameters

entityType object
dependentType object
principalType object

Returns

string

EntityTypeNotInRelationshipStrict(object?, object?, object?)

The specified entity type '{entityType}' is invalid. It must be either the dependent entity type '{dependentType}' or the principal entity type '{principalType}'.

public static string EntityTypeNotInRelationshipStrict(object? entityType, object? dependentType, object? principalType)

Parameters

entityType object
dependentType object
principalType object

Returns

string

EntityTypesNotInRelationship(object?, object?, object?, object?)

The provided entity types '{invalidDependentType}' and '{invalidPrincipalType}' are invalid. Specify '{dependentType}' and '{principalType}', or entity types in the same hierarchy.

public static string EntityTypesNotInRelationship(object? invalidDependentType, object? invalidPrincipalType, object? dependentType, object? principalType)

Parameters

invalidDependentType object
invalidPrincipalType object
dependentType object
principalType object

Returns

string

ErrorMaterializingPropertyInvalidCast(object?, object?, object?, object?)

An error occurred while reading a database value for property '{entityType}.{property}'. The expected type was '{expectedType}' but the actual value was of type '{actualType}'.

public static string ErrorMaterializingPropertyInvalidCast(object? entityType, object? property, object? expectedType, object? actualType)

Parameters

entityType object
property object
expectedType object
actualType object

Returns

string

ExecutionStrategyExistingTransaction(object?, object?)

The configured execution strategy '{strategy}' does not support user-initiated transactions. Use the execution strategy returned by '{getExecutionStrategyMethod}' to execute all the operations in the transaction as a retriable unit.

public static string ExecutionStrategyExistingTransaction(object? strategy, object? getExecutionStrategyMethod)

Parameters

strategy object
getExecutionStrategyMethod object

Returns

string

ExpressionParameterizationExceptionSensitive(object?)

An exception was thrown while attempting to evaluate the LINQ query parameter expression '{expression}'. See the inner exception for more information.

public static string ExpressionParameterizationExceptionSensitive(object? expression)

Parameters

expression object

Returns

string

FieldNameMismatch(object?, object?, object?)

The specified field '{field}' cannot be used for the property '{entityType}.{property}' because it does not match the property name. Entity type properties that aren't associated with a CLR property must match the field name exactly.

public static string FieldNameMismatch(object? field, object? entityType, object? property)

Parameters

field object
entityType object
property object

Returns

string

FindNotCompositeKey(object?, object?)

Entity type '{entityType}' is defined with a single key property, but {valuesCount} values were passed to the 'Find' method.

public static string FindNotCompositeKey(object? entityType, object? valuesCount)

Parameters

entityType object
valuesCount object

Returns

string

FindValueCountMismatch(object?, object?, object?)

Entity type '{entityType}' is defined with a {propertiesCount}-part composite key, but {valuesCount} values were passed to the 'Find' method.

public static string FindValueCountMismatch(object? entityType, object? propertiesCount, object? valuesCount)

Parameters

entityType object
propertiesCount object
valuesCount object

Returns

string

FindValueTypeMismatch(object?, object?, object?, object?)

The key value at position {index} of the call to 'DbSet<{entityType}>.Find' was of type '{valueType}', which does not match the property type of '{propertyType}'.

public static string FindValueTypeMismatch(object? index, object? entityType, object? valueType, object? propertyType)

Parameters

index object
entityType object
valueType object
propertyType object

Returns

string

FindWrongCount(object?, object?)

{values} value(s) were passed to the 'FindEntry' or 'GetEntries' method for {properties} properties. The number of values must match the number of properties.

public static string FindWrongCount(object? values, object? properties)

Parameters

values object
properties object

Returns

string

FindWrongType(object?, object?, object?)

The 'FindEntry' or 'GetEntries' method was passed a '{valueType}' value for the '{propertyName}' property, when a '{propertyType}' value was expected.

public static string FindWrongType(object? valueType, object? propertyName, object? propertyType)

Parameters

valueType object
propertyName object
propertyType object

Returns

string

FkAttributeOnNonUniquePrincipal(object?, object?, object?)

The [ForeignKey] attribute for the navigation '{navigation}' cannot be specified on the entity type '{principalType}' since it represents a one-to-many relationship. Move the [ForeignKey] attribute to a property on '{dependentType}'.

public static string FkAttributeOnNonUniquePrincipal(object? navigation, object? principalType, object? dependentType)

Parameters

navigation object
principalType object
dependentType object

Returns

string

FkAttributeOnPropertyNavigationMismatch(object?, object?, object?)

The [ForeignKey] attributes on property '{property}' and navigation '{navigation}' in entity type '{entityType}' do not point at each other. Make sure the value of the [ForeignKey] attribute on the property matches the navigation name, and the value of the [ForeignKey] attribute on the navigation matches the foreign key property name or remove one of them.

public static string FkAttributeOnPropertyNavigationMismatch(object? property, object? navigation, object? entityType)

Parameters

property object
navigation object
entityType object

Returns

string

FkAttributeOnSkipNavigation(object?, object?)

The [ForeignKey] attribute cannot be specified on the skip navigation '{entityType}'.'{navigation}'. Configure the foreign key properties in 'OnModelCreating' instead.

public static string FkAttributeOnSkipNavigation(object? entityType, object? navigation)

Parameters

entityType object
navigation object

Returns

string

ForeignKeyCountMismatch(object?, object?, object?, object?)

The number of properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKeyProperties} on entity type '{principalType}'.

public static string ForeignKeyCountMismatch(object? foreignKeyProperties, object? dependentType, object? principalKeyProperties, object? principalType)

Parameters

foreignKeyProperties object
dependentType object
principalKeyProperties object
principalType object

Returns

string

ForeignKeyInUseSkipNavigation(object?, object?, object?, object?)

Cannot remove the foreign key {foreignKeyProperties} from entity type '{entityType}' because it is referenced by a skip navigation '{navigation}' on entity type '{navigationEntityType}'. All referencing skip navigations must be removed before the referenced foreign key can be removed.

public static string ForeignKeyInUseSkipNavigation(object? foreignKeyProperties, object? entityType, object? navigation, object? navigationEntityType)

Parameters

foreignKeyProperties object
entityType object
navigation object
navigationEntityType object

Returns

string

ForeignKeyPropertiesWrongEntity(object?, object?)

The specified foreign key properties {foreignKeyProperties} are not declared on the entity type '{entityType}'. Ensure that foreign key properties are declared on the target entity type.

public static string ForeignKeyPropertiesWrongEntity(object? foreignKeyProperties, object? entityType)

Parameters

foreignKeyProperties object
entityType object

Returns

string

ForeignKeyPropertyInKey(object?, object?, object?, object?)

The property '{property}' cannot be part of a foreign key on '{entityType}' because it has a store-generated value and is contained in the key {keyProperties} defined on a base entity type '{baseEntityType}'. Configure '{property}' with 'ValueGeneratedNever' or define the foreign key on '{entityType}' instead.

public static string ForeignKeyPropertyInKey(object? property, object? entityType, object? keyProperties, object? baseEntityType)

Parameters

property object
entityType object
keyProperties object
baseEntityType object

Returns

string

ForeignKeyReferencedEntityKeyMismatch(object?, object?)

The provided principal key {principalKeyProperties} is not a key on the entity type '{principalEntityType}'. Provide a key that's defined on the principal entity type.

public static string ForeignKeyReferencedEntityKeyMismatch(object? principalKeyProperties, object? principalEntityType)

Parameters

principalKeyProperties object
principalEntityType object

Returns

string

ForeignKeyTypeMismatch(object?, object?, object?, object?)

The types of the properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKeyProperties} on entity type '{principalType}'. Provide properties that use the same types in the same order.

public static string ForeignKeyTypeMismatch(object? foreignKeyProperties, object? dependentType, object? principalKeyProperties, object? principalType)

Parameters

foreignKeyProperties object
dependentType object
principalKeyProperties object
principalType object

Returns

string

ForeignKeyWrongType(object?, object?, object?, object?, object?)

The foreign key {foreignKeyProperties} targeting the key {keyProperties} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.

public static string ForeignKeyWrongType(object? foreignKeyProperties, object? keyProperties, object? principalType, object? entityType, object? otherEntityType)

Parameters

foreignKeyProperties object
keyProperties object
principalType object
entityType object
otherEntityType object

Returns

string

FullChangeTrackingRequired(object?, object?, object?, object?)

The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy when full change tracking notifications are required. Use 'ModelBuilder.HasChangeTrackingStrategy' in 'OnModelCreating' to configure all entity types in the model to use the '{fullStrategy}' or '{fullPlusStrategy}' strategy.

public static string FullChangeTrackingRequired(object? entityType, object? changeTrackingStrategy, object? fullStrategy, object? fullPlusStrategy)

Parameters

entityType object
changeTrackingStrategy object
fullStrategy object
fullPlusStrategy object

Returns

string

FunctionOnClient(object?)

The '{methodName}' method is not supported because the query has switched to client-evaluation. This usually happens when the arguments to the method cannot be translated to server. Rewrite the query to avoid client evaluation of arguments so that method can be translated to server.

public static string FunctionOnClient(object? methodName)

Parameters

methodName object

Returns

string

GraphDoesNotContainVertex(object?)

The provided edge cannot be added because the graph does not contain the vertex '{vertex}'.

public static string GraphDoesNotContainVertex(object? vertex)

Parameters

vertex object

Returns

string

IQueryableNotAsync(object?)

The source 'IQueryable' doesn't implement 'IAsyncEnumerable<{genericParameter}>'. Only sources that implement 'IAsyncEnumerable' can be used for Entity Framework asynchronous operations.

public static string IQueryableNotAsync(object? genericParameter)

Parameters

genericParameter object

Returns

string

IdentifyingRelationshipCycle(object?)

A relationship cycle involving the primary keys of the following entity types was detected: '{entityType}'. This would prevent any entity to be inserted without violating the store constraints. Review the foreign keys defined on the primary keys and either remove or use other properties for at least one of them.

public static string IdentifyingRelationshipCycle(object? entityType)

Parameters

entityType object

Returns

string

IdentityConflict(object?, object?)

The instance of entity type '{entityType}' cannot be tracked because another instance with the same key value for {keyProperties} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

public static string IdentityConflict(object? entityType, object? keyProperties)

Parameters

entityType object
keyProperties object

Returns

string

IdentityConflictOwned(object?, object?)

The instance of entity type '{entityType}' cannot be tracked because another instance with the same key value for {keyProperties} is already being tracked. When replacing owned entities, modify the properties without changing the instance or detach the previous owned entity entry first. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

public static string IdentityConflictOwned(object? entityType, object? keyProperties)

Parameters

entityType object
keyProperties object

Returns

string

IdentityConflictOwnedSensitive(object?, object?)

The instance of entity type '{entityType}' cannot be tracked because another instance with the key value '{keyValue}' is already being tracked. When replacing owned entities, modify the properties without changing the instance or detach the previous owned entity entry first.

public static string IdentityConflictOwnedSensitive(object? entityType, object? keyValue)

Parameters

entityType object
keyValue object

Returns

string

IdentityConflictSensitive(object?, object?)

The instance of entity type '{entityType}' cannot be tracked because another instance with the key value '{keyValue}' is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached.

public static string IdentityConflictSensitive(object? entityType, object? keyValue)

Parameters

entityType object
keyValue object

Returns

string

ImplementationTypeRequired(object?)

The implementation type for the registration of the '{service}' service could not be determined. Specific implementation types must be used for services that expect multiple registrations so as to avoid duplicates.

public static string ImplementationTypeRequired(object? service)

Parameters

service object

Returns

string

IncludeOnEntityWithDefiningQueryNotSupported(object?, object?)

The 'Include' operation with argument '{expression}' is not supported on entity type '{entityType}' because it has a defining query.

[Obsolete]
public static string IncludeOnEntityWithDefiningQueryNotSupported(object? expression, object? entityType)

Parameters

expression object
entityType object

Returns

string

IncludeOnNonEntity(object?)

Cannot apply the 'Include' operation with argument '{expression}'. Either the source is not a queryable of a known entity type or 'Include' has been applied after 'Select' method which projects a different entity type through navigation. Consider applying 'Include' before 'Select' method call.

public static string IncludeOnNonEntity(object? expression)

Parameters

expression object

Returns

string

IncludeWithCycle(object?, object?)

The Include path '{navigationName}->{inverseNavigationName}' results in a cycle. Cycles are not allowed in no-tracking queries; either use a tracking query or remove the cycle.

public static string IncludeWithCycle(object? navigationName, object? inverseNavigationName)

Parameters

navigationName object
inverseNavigationName object

Returns

string

InconsistentInheritance(object?, object?, object?)

The entity type '{entityType}' is configured as derived from '{baseEntityType}', however according to the hierarchy of the corresponding CLR types it should derive from '{clrBaseEntityType}'. Configure '{entityType}' having either '{baseEntityType}' or 'null' as the base type.

public static string InconsistentInheritance(object? entityType, object? baseEntityType, object? clrBaseEntityType)

Parameters

entityType object
baseEntityType object
clrBaseEntityType object

Returns

string

IncorrectNumberOfArguments(object?, object?, object?)

'{method}' was invoked with {argumentCount} arguments, but has {parameterCount} parameters.

public static string IncorrectNumberOfArguments(object? method, object? argumentCount, object? parameterCount)

Parameters

method object
argumentCount object
parameterCount object

Returns

string

IndexPropertiesWrongEntity(object?, object?)

The specified index properties {indexProperties} are not declared on the entity type '{entityType}'. Ensure that index properties are declared on the target entity type.

public static string IndexPropertiesWrongEntity(object? indexProperties, object? entityType)

Parameters

indexProperties object
entityType object

Returns

string

IndexWrongType(object?, object?, object?)

The index {index} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.

public static string IndexWrongType(object? index, object? entityType, object? otherEntityType)

Parameters

index object
entityType object
otherEntityType object

Returns

string

InheritedPropertyCannotBeIgnored(object?, object?, object?)

The property '{property}' cannot be ignored on type '{type}' because it's declared on the base type '{baseType}'. To exclude this property from your model, use the [NotMapped] attribute or 'Ignore' on the base type in 'OnModelCreating'.

public static string InheritedPropertyCannotBeIgnored(object? property, object? type, object? baseType)

Parameters

property object
type object
baseType object

Returns

string

InterfacePropertyNotAdded(object?, object?, object?)

The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation, manually configure the relationship for this property by casting it to a mapped entity type. Otherwise, ignore the property using the [NotMapped] attribute or 'Ignore' in 'OnModelCreating'.

public static string InterfacePropertyNotAdded(object? entityType, object? navigation, object? propertyType)

Parameters

entityType object
navigation object
propertyType object

Returns

string

InvalidAlternateKeyValue(object?, object?)

Unable to track an entity of type '{entityType}' because alternate key property '{keyProperty}' is null. If the alternate key is not used in a relationship, then consider using a unique index instead. Unique indexes may contain nulls, while alternate keys may not.

public static string InvalidAlternateKeyValue(object? entityType, object? keyProperty)

Parameters

entityType object
keyProperty object

Returns

string

InvalidComplexType(object?)

The specified type '{type}' must be a non-interface type with a public constructor to be used as a complex type.

public static string InvalidComplexType(object? type)

Parameters

type object

Returns

string

InvalidEntityType(object?)

The specified type '{type}' must be a non-interface reference type to be used as an entity type.

public static string InvalidEntityType(object? type)

Parameters

type object

Returns

string

InvalidEntityTypeConfigurationAttribute(object?, object?)

The entity type configuration of type '{entityTypeConfigurationType}' is invalid. The configuration specified using EntityTypeConfigurationAttribute has to implement 'IEntityTypeConfiguration<{entityType}>'.

public static string InvalidEntityTypeConfigurationAttribute(object? entityTypeConfigurationType, object? entityType)

Parameters

entityTypeConfigurationType object
entityType object

Returns

string

InvalidEnumValue(object?, object?, object?)

The value '{value}' provided for argument '{argumentName}' must be a valid value of enum type '{enumType}'.

public static string InvalidEnumValue(object? value, object? argumentName, object? enumType)

Parameters

value object
argumentName object
enumType object

Returns

string

InvalidIncludeExpression(object?)

The expression '{expression}' is invalid inside an 'Include' operation, since it does not represent a property access: 't => t.MyProperty'. To target navigations declared on derived types, use casting ('t => ((Derived)t).MyProperty') or the 'as' operator ('t => (t as Derived).MyProperty'). Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations. For more information on including related data, see https://go.microsoft.com/fwlink/?LinkID=746393.

public static string InvalidIncludeExpression(object? expression)

Parameters

expression object

Returns

string

InvalidKeyValue(object?, object?)

Unable to track an entity of type '{entityType}' because its primary key property '{keyProperty}' is null.

public static string InvalidKeyValue(object? entityType, object? keyProperty)

Parameters

entityType object
keyProperty object

Returns

string

InvalidMemberExpression(object?)

The expression '{expression}' is not a valid member access expression. The expression should represent a simple property or field access: 't => t.MyProperty'.

public static string InvalidMemberExpression(object? expression)

Parameters

expression object

Returns

string

InvalidMembersExpression(object?)

The expression '{expression}' is not a valid member access expression. The expression should represent a simple property or field access: 't => t.MyProperty'. When specifying multiple properties or fields, use an anonymous type: 't => new {{ t.MyProperty, t.MyField }}'.

public static string InvalidMembersExpression(object? expression)

Parameters

expression object

Returns

string

InvalidNavigationWithInverseProperty(object?, object?, object?, object?)

The [InverseProperty] attribute on property '{1_entityType}.{0_property}' is not valid. The property '{referencedProperty}' is not a valid navigation on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation.

public static string InvalidNavigationWithInverseProperty(object? property, object? entityType, object? referencedProperty, object? referencedEntityType)

Parameters

property object
entityType object
referencedProperty object
referencedEntityType object

Returns

string

InvalidNumberOfIndexSortOrderValues(object?, object?, object?)

Invalid number of index sort order values provided for {indexProperties}: {numValues} values were provided, but the index has {numProperties} properties.

public static string InvalidNumberOfIndexSortOrderValues(object? indexProperties, object? numValues, object? numProperties)

Parameters

indexProperties object
numValues object
numProperties object

Returns

string

InvalidPropertyListOnNavigation(object?, object?, object?)

The property list specified using [ForeignKey("{2_properties}")] attribute on navigation '{1_entityType}.{0_navigation}' is incorrect. Provide a comma-separated list of property names.

public static string InvalidPropertyListOnNavigation(object? navigation, object? entityType, object? properties)

Parameters

navigation object
entityType object
properties object

Returns

string

InvalidRelationshipUsingDataAnnotations(object?, object?, object?, object?)

An invalid relationship has been specified using the [InverseProperty] and [ForeignKey] attributes. The navigations '{1_entityType}.{0_navigation}' and '{3_referencedEntityType}.{2_referencedNavigation}' are related by the [InverseProperty] attribute, but the [ForeignKey] attributes specified for both navigations have different values. Either specify the same properties or remove one of the attributes.

public static string InvalidRelationshipUsingDataAnnotations(object? navigation, object? entityType, object? referencedNavigation, object? referencedEntityType)

Parameters

navigation object
entityType object
referencedNavigation object
referencedEntityType object

Returns

string

InvalidReplaceService(object?, object?)

A call was made to '{replaceService}', but Entity Framework is not building its own internal service provider. Either allow Entity Framework to build the service provider by removing the call to '{useInternalServiceProvider}', or build replacement services into the service provider before passing it to '{useInternalServiceProvider}'.

public static string InvalidReplaceService(object? replaceService, object? useInternalServiceProvider)

Parameters

replaceService object
useInternalServiceProvider object

Returns

string

InvalidSetKeylessOperation(object?)

The invoked method cannot be used for the entity type '{entityType}' because it does not have a primary key. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string InvalidSetKeylessOperation(object? entityType)

Parameters

entityType object

Returns

string

InvalidSetSameTypeWithDifferentNamespace(object?, object?)

Cannot create a DbSet for '{typeName}' because this type is not included in the model for the context. However the model contains an entity type with the same name in a different namespace: '{entityTypeName}'.

public static string InvalidSetSameTypeWithDifferentNamespace(object? typeName, object? entityTypeName)

Parameters

typeName object
entityTypeName object

Returns

string

InvalidSetSharedType(object?)

Cannot create a DbSet for '{typeName}' because it is configured as an shared-type entity type. Access the entity type via the 'Set' method overload that accepts an entity type name.

public static string InvalidSetSharedType(object? typeName)

Parameters

typeName object

Returns

string

InvalidSetType(object?)

Cannot create a DbSet for '{typeName}' because this type is not included in the model for the context.

public static string InvalidSetType(object? typeName)

Parameters

typeName object

Returns

string

InvalidSetTypeOwned(object?, object?)

Cannot create a DbSet for '{typeName}' because it is configured as an owned entity type and must be accessed through its owning entity type '{ownerType}'. See https://aka.ms/efcore-docs-owned for more information.

public static string InvalidSetTypeOwned(object? typeName, object? ownerType)

Parameters

typeName object
ownerType object

Returns

string

InvalidSwitch(object?, object?)

Invalid {name}: {value}

public static string InvalidSwitch(object? name, object? value)

Parameters

name object
value object

Returns

string

InvalidType(object?, object?, object?, object?)

The value for property '{1_entityType}.{0_property}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'.

public static string InvalidType(object? property, object? entityType, object? valueType, object? propertyType)

Parameters

property object
entityType object
valueType object
propertyType object

Returns

string

InvalidTypeConversationWithInclude(object?, object?)

Unable to include navigation chain '{includeExpression}' specified by 'Include' operation as the converted type '{type}' is not part of model.

public static string InvalidTypeConversationWithInclude(object? includeExpression, object? type)

Parameters

includeExpression object
type object

Returns

string

InvalidUseService(object?, object?, object?)

A call was made to '{useService}', but Entity Framework is not building its own internal service provider. Either allow Entity Framework to build the service provider by removing the call to '{useInternalServiceProvider}', or build the '{service}' services to use into the service provider before passing it to '{useInternalServiceProvider}'.

public static string InvalidUseService(object? useService, object? useInternalServiceProvider, object? service)

Parameters

useService object
useInternalServiceProvider object
service object

Returns

string

InvalidValueGeneratorFactoryProperty(object?, object?, object?)

The '{factory}' cannot create a value generator for property '{2_entityType}.{1_property}'. Only integer properties are supported.

public static string InvalidValueGeneratorFactoryProperty(object? factory, object? property, object? entityType)

Parameters

factory object
property object
entityType object

Returns

string

InversePropertyMismatch(object?, object?, object?, object?)

[InverseProperty] attributes on navigation '{1_entityType}.{0_navigation}' and on navigation '{3_referencedEntityType}.{2_referencedNavigation}' are not pointing to each other. Change the attributes to use the corresponding names or remove one of them.

public static string InversePropertyMismatch(object? navigation, object? entityType, object? referencedNavigation, object? referencedEntityType)

Parameters

navigation object
entityType object
referencedNavigation object
referencedEntityType object

Returns

string

InverseToOwnedType(object?, object?, object?, object?)

The navigation '{principalEntityType}.{navigation}' is not supported because it is pointing to an owned entity type '{ownedType}'. Only the ownership navigation from the entity type '{ownerType}' can point to the owned entity type. See https://aka.ms/efcore-docs-owned for more information.

public static string InverseToOwnedType(object? principalEntityType, object? navigation, object? ownedType, object? ownerType)

Parameters

principalEntityType object
navigation object
ownedType object
ownerType object

Returns

string

JsonReaderInvalidTokenType(object?)

Invalid token type: '{tokenType}'.

public static string JsonReaderInvalidTokenType(object? tokenType)

Parameters

tokenType object

Returns

string

KeyAttributeOnDerivedEntity(object?, object?, object?)

The derived type '{derivedType}' cannot have the [Key] attribute on property '{property}' since primary keys may only be declared on the root type. Move the property '{property}' to '{rootType}' or remove '{rootType}' from the model by using [NotMapped] attribute or calling 'EntityTypeBuilder.Ignore' on the base type in 'OnModelCreating'.

public static string KeyAttributeOnDerivedEntity(object? derivedType, object? property, object? rootType)

Parameters

derivedType object
property object
rootType object

Returns

string

KeyInUse(object?, object?, object?, object?)

Cannot remove key {keyProperties} from entity type '{entityType}' because it is referenced by a foreign key {foreignKeyProperties} defined on entity type '{dependentType}'. Remove or change the principal key for all referencing foreign keys before removing the key.

public static string KeyInUse(object? keyProperties, object? entityType, object? foreignKeyProperties, object? dependentType)

Parameters

keyProperties object
entityType object
foreignKeyProperties object
dependentType object

Returns

string

KeyPropertiesWrongEntity(object?, object?)

The specified key properties {keyProperties} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type.

public static string KeyPropertiesWrongEntity(object? keyProperties, object? entityType)

Parameters

keyProperties object
entityType object

Returns

string

KeyPropertyCannotBeNullable(object?, object?, object?)

The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because it has been included in the key {keyProperties}.

public static string KeyPropertyCannotBeNullable(object? property, object? entityType, object? keyProperties)

Parameters

property object
entityType object
keyProperties object

Returns

string

KeyPropertyMustBeReadOnly(object?, object?)

The property '{1_entityType}.{0_property}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time.

public static string KeyPropertyMustBeReadOnly(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

KeyReadOnly(object?, object?)

The property '{1_entityType}.{0_property}' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.

public static string KeyReadOnly(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

KeyWrongType(object?, object?, object?)

The key {keyProperties} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.

public static string KeyWrongType(object? keyProperties, object? entityType, object? otherEntityType)

Parameters

keyProperties object
entityType object
otherEntityType object

Returns

string

KeylessTypeExistingKey(object?, object?)

The entity type '{entityType}' cannot be marked as keyless because it contains a key {keyProperties}.

public static string KeylessTypeExistingKey(object? entityType, object? keyProperties)

Parameters

entityType object
keyProperties object

Returns

string

KeylessTypeTracked(object?)

Unable to track an instance of type '{type}' because it does not have a primary key. Only entity types with a primary key may be tracked.

public static string KeylessTypeTracked(object? type)

Parameters

type object

Returns

string

KeylessTypeWithKey(object?, object?)

The key {keyProperties} cannot be added to keyless type '{entityType}'.

public static string KeylessTypeWithKey(object? keyProperties, object? entityType)

Parameters

keyProperties object
entityType object

Returns

string

LiteralGenerationNotSupported(object?)

The type mapping for '{type}' has not implemented code literal generation.

public static string LiteralGenerationNotSupported(object? type)

Parameters

type object

Returns

string

ManyToManyOneNav(object?, object?)

The navigation '{entityType}.{navigation}' cannot be used for both sides of a many-to-many relationship. Many-to-many relationships must use two distinct navigation properties.

public static string ManyToManyOneNav(object? entityType, object? navigation)

Parameters

entityType object
navigation object

Returns

string

MissingBackingField(object?, object?, object?)

The specified field '{field}' could not be found for property '{2_entityType}.{1_property}'.

public static string MissingBackingField(object? field, object? property, object? entityType)

Parameters

field object
property object
entityType object

Returns

string

ModelNotFinalized(object?)

The model must be finalized and its runtime dependencies must be initialized before '{method}' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'IModelRuntimeInitializer.Initialize(model.FinalizeModel())' was called.

public static string ModelNotFinalized(object? method)

Parameters

method object

Returns

string

MultipleFilteredIncludesOnSameNavigation(object?, object?)

The filters '{filter1}' and '{filter2}' have both been configured on the same included navigation. Only one unique filter per navigation is allowed. For more information on including related data, see https://go.microsoft.com/fwlink/?LinkID=746393.

public static string MultipleFilteredIncludesOnSameNavigation(object? filter1, object? filter2)

Parameters

filter1 object
filter2 object

Returns

string

MultipleNavigationsSameFk(object?, object?, object?)

There are multiple navigations in entity type '{entityType}' which are pointing to same set of properties '{properties}' using a [ForeignKey] attribute: {navigations}.

public static string MultipleNavigationsSameFk(object? entityType, object? properties, object? navigations)

Parameters

entityType object
properties object
navigations object

Returns

string

MultipleOwnerships(object?, object?)

The entity type '{entityType}' is the target of multiple ownership relationships: {navigations}.

public static string MultipleOwnerships(object? entityType, object? navigations)

Parameters

entityType object
navigations object

Returns

string

MultipleProvidersConfigured(object?)

Services for database providers {storeNames} have been registered in the service provider. Only a single database provider can be registered in a service provider. If possible, ensure that Entity Framework is managing its service provider by removing the call to 'UseInternalServiceProvider'. Otherwise, consider conditionally registering the database provider, or maintaining one service provider per database provider.

public static string MultipleProvidersConfigured(object? storeNames)

Parameters

storeNames object

Returns

string

MustRewriteToSameNode(object?, object?)

When called from '{caller}', rewriting a node of type '{type}' must return a non-null value of the same type. Alternatively, override '{caller}' and change it to not visit children of this type.

public static string MustRewriteToSameNode(object? caller, object? type)

Parameters

caller object
type object

Returns

string

MutableKeyProperty(object?)

The property '{keyProperty}' cannot be configured as 'ValueGeneratedOnUpdate' or 'ValueGeneratedOnAddOrUpdate' because it's part of a key and its value cannot be changed after the entity has been added to the store.

public static string MutableKeyProperty(object? keyProperty)

Parameters

keyProperty object

Returns

string

NamedIndexDefinedOnIgnoredProperty(object?, object?, object?, object?)

The index '{indexName}' specified via [Index] attribute on the entity type '{entityType}' with properties {indexProperties} is invalid. The property '{propertyName}' has been marked as unmapped via the [NotMapped] attribute or the 'EntityTypeBuilder.Ignore' fluent API. An index cannot use unmapped properties.

public static string NamedIndexDefinedOnIgnoredProperty(object? indexName, object? entityType, object? indexProperties, object? propertyName)

Parameters

indexName object
entityType object
indexProperties object
propertyName object

Returns

string

NamedIndexDefinedOnNonExistentProperty(object?, object?, object?, object?)

An index '{indexName}' specified via [Index] attribute on the entity type '{entityType}' references properties {indexProperties}, but no property with name '{propertyName}' exists on that entity type or any of its base types.

public static string NamedIndexDefinedOnNonExistentProperty(object? indexName, object? entityType, object? indexProperties, object? propertyName)

Parameters

indexName object
entityType object
indexProperties object
propertyName object

Returns

string

NamedIndexWrongType(object?, object?)

The index with name {indexName} cannot be removed from the entity type '{entityType}' because no such index exists on that entity type.

public static string NamedIndexWrongType(object? indexName, object? entityType)

Parameters

indexName object
entityType object

Returns

string

NavigationArray(object?, object?, object?)

The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigations cannot be arrays.

public static string NavigationArray(object? navigation, object? entityType, object? foundType)

Parameters

navigation object
entityType object
foundType object

Returns

string

NavigationBadType(object?, object?, object?, object?)

The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which does not implement 'ICollection<{targetType}>'. Collection navigations must implement 'ICollection<>' of the target type.

public static string NavigationBadType(object? navigation, object? entityType, object? foundType, object? targetType)

Parameters

navigation object
entityType object
foundType object
targetType object

Returns

string

NavigationCannotCreateType(object?, object?, object?)

The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a 'HashSet<>' or 'List<>'.

public static string NavigationCannotCreateType(object? navigation, object? entityType, object? foundType)

Parameters

navigation object
entityType object
foundType object

Returns

string

NavigationCollectionWrongClrType(object?, object?, object?, object?)

The collection navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigations must implement IEnumerable<> of the related entity.

public static string NavigationCollectionWrongClrType(object? navigation, object? entityType, object? clrType, object? targetType)

Parameters

navigation object
entityType object
clrType object
targetType object

Returns

string

NavigationForWrongForeignKey(object?, object?, object?, object?)

The navigation '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetForeignKeyProperties} because it was created for foreign key {actualForeignKeyProperties}.

public static string NavigationForWrongForeignKey(object? navigation, object? entityType, object? targetForeignKeyProperties, object? actualForeignKeyProperties)

Parameters

navigation object
entityType object
targetForeignKeyProperties object
actualForeignKeyProperties object

Returns

string

NavigationIsProperty(object?, object?, object?, object?, object?)

The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' or '{collectionMethod}' method, but is defined in the model as a non-navigation. Use the '{propertyMethod}' method to access non-navigation properties.

public static string NavigationIsProperty(object? property, object? entityType, object? referenceMethod, object? collectionMethod, object? propertyMethod)

Parameters

property object
entityType object
referenceMethod object
collectionMethod object
propertyMethod object

Returns

string

NavigationNoSetter(object?, object?)

The navigation '{1_entityType}.{0_navigation}' does not have a setter and no writable backing field was found or specified. Read-only collection navigations must be initialized before use.

public static string NavigationNoSetter(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

NavigationNotAdded(object?, object?, object?)

Unable to determine the relationship represented by navigation '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

public static string NavigationNotAdded(object? entityType, object? navigation, object? propertyType)

Parameters

entityType object
navigation object
propertyType object

Returns

string

NavigationNotAddedAdHoc(object?, object?, object?)

The property '{entityType}.{navigation}' of type '{propertyType}' appears to be a navigation to another entity type. Navigations are not supported when using 'SqlQuery". Either include this type in the model and use 'FromSql' for the query, or ignore this property using the '[NotMapped]' attribute.

public static string NavigationNotAddedAdHoc(object? entityType, object? navigation, object? propertyType)

Parameters

entityType object
navigation object
propertyType object

Returns

string

NavigationNotAddedComplexType(object?, object?, object?)

Unable to configure navigation '{complexType}.{navigation}' of type '{propertyType}' as complex types don't support navigations. Ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

public static string NavigationNotAddedComplexType(object? complexType, object? navigation, object? propertyType)

Parameters

complexType object
navigation object
propertyType object

Returns

string

NavigationSingleWrongClrType(object?, object?, object?, object?)

The navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'.

public static string NavigationSingleWrongClrType(object? navigation, object? entityType, object? clrType, object? targetType)

Parameters

navigation object
entityType object
clrType object
targetType object

Returns

string

NavigationToKeylessType(object?, object?)

The navigation '{navigation}' cannot be added because it targets the keyless entity type '{entityType}'. Navigations can only target entity types with keys. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string NavigationToKeylessType(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

NavigationlessOwnership(object?, object?)

The relationship between '{principalEntityType}' and '{dependentEntityType}' cannot be configured as an ownership as there is no associated navigation to the owned type. An ownership must always have an associated navigation. See https://aka.ms/efcore-docs-owned for more information.

public static string NavigationlessOwnership(object? principalEntityType, object? dependentEntityType)

Parameters

principalEntityType object
dependentEntityType object

Returns

string

NoBackingField(object?, object?, object?)

No backing field was found for property '{1_entityType}.{0_property}'. Name the backing field so that it is discovered by convention, configure the backing field to use, or use a different '{propertyAccessMode}'.

public static string NoBackingField(object? property, object? entityType, object? propertyAccessMode)

Parameters

property object
entityType object
propertyAccessMode object

Returns

string

NoBackingFieldLazyLoading(object?, object?)

No backing field was found for property '{1_entityType}.{0_property}'. Lazy-loaded navigations must have backing fields. Either name the backing field so that it is discovered by convention or configure the backing field to use.

public static string NoBackingFieldLazyLoading(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

NoClrNavigation(object?, object?)

The navigation '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state.

public static string NoClrNavigation(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

NoDiscriminatorProperty(object?)

The entity type '{entityType}' is part of a hierarchy, but does not have a discriminator property configured.

public static string NoDiscriminatorProperty(object? entityType)

Parameters

entityType object

Returns

string

NoDiscriminatorValue(object?)

The entity type '{entityType}' has a discriminator property, but does not have a discriminator value configured.

public static string NoDiscriminatorValue(object? entityType)

Parameters

entityType object

Returns

string

NoFieldOrGetter(object?, object?)

No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a getter.

public static string NoFieldOrGetter(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

NoFieldOrSetter(object?, object?)

No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a setter.

public static string NoFieldOrSetter(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

NoGetter(object?, object?, object?)

The property '{1_entityType}.{0_property}' does not have a getter. Either make the property readable or use a different '{propertyAccessMode}'.

public static string NoGetter(object? property, object? entityType, object? propertyAccessMode)

Parameters

property object
entityType object
propertyAccessMode object

Returns

string

NoParameterlessConstructor(object?)

A parameterless constructor was not found on entity type '{entityType}'. In order to create an instance of '{entityType}', Entity Framework requires that a parameterless constructor be declared.

public static string NoParameterlessConstructor(object? entityType)

Parameters

entityType object

Returns

string

NoProperty(object?, object?, object?)

No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{propertyAccessMode}'.

public static string NoProperty(object? field, object? entity, object? propertyAccessMode)

Parameters

field object
entity object
propertyAccessMode object

Returns

string

NoPropertyType(object?, object?)

The property '{property}' cannot be added to the type '{type}' because no property type was specified and there is no corresponding CLR property or field. To add a shadow state property, the property type must be specified.

public static string NoPropertyType(object? property, object? type)

Parameters

property object
type object

Returns

string

NoProviderConfiguredFailedToResolveService(object?)

Unable to resolve service for type '{service}'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

public static string NoProviderConfiguredFailedToResolveService(object? service)

Parameters

service object

Returns

string

NoSetter(object?, object?, object?)

The property '{1_entityType}.{0_property}' does not have a setter. Either make the property writable or use a different '{propertyAccessMode}'.

public static string NoSetter(object? property, object? entityType, object? propertyAccessMode)

Parameters

property object
entityType object
propertyAccessMode object

Returns

string

NoValueGenerator(object?, object?, object?)

The property '{1_entityType}.{0_property}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}' in 'OnModelCreating'.

public static string NoValueGenerator(object? property, object? entityType, object? propertyType)

Parameters

property object
entityType object
propertyType object

Returns

string

NonComparableKeyType(object?, object?, object?)

Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion' in 'OnModelCreating' to wrap '{providerType}' with a type that can be compared.

public static string NonComparableKeyType(object? entityType, object? property, object? providerType)

Parameters

entityType object
property object
providerType object

Returns

string

NonComparableKeyTypes(object?, object?, object?, object?)

Property '{entityType}.{property}' cannot be used as a key because it has type '{modelType}' and provider type '{providerType}', neither of which implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Make '{modelType}' implement one of these interfaces to use it as a key.

public static string NonComparableKeyTypes(object? entityType, object? property, object? modelType, object? providerType)

Parameters

entityType object
property object
modelType object
providerType object

Returns

string

NonConfiguredNavigationToSharedType(object?, object?)

The navigation '{1_entityType}.{0_navigation}' must be configured in 'OnModelCreating' with an explicit name for the target shared-type entity type, or excluded by calling 'EntityTypeBuilder.Ignore'.

public static string NonConfiguredNavigationToSharedType(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

NonGenericOptions(object?)

The DbContextOptions passed to the {contextType} constructor must be a DbContextOptions<{contextType}>. When registering multiple DbContext types, make sure that the constructor for each context type has a DbContextOptions<TContext> parameter rather than a non-generic DbContextOptions parameter.

public static string NonGenericOptions(object? contextType)

Parameters

contextType object

Returns

string

NonIndexerEntityType(object?, object?, object?)

Cannot add indexer property '{property}' since there is no indexer on '{entityType}' taking a single argument of type assignable from '{type}'.

public static string NonIndexerEntityType(object? property, object? entityType, object? type)

Parameters

property object
entityType object
type object

Returns

string

NonNotifyingCollection(object?, object?, object?, object?)

The collection type '{2_collectionType}' being used for navigation '{1_entityType}.{0_navigation}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this.

public static string NonNotifyingCollection(object? navigation, object? entityType, object? collectionType, object? changeTrackingStrategy)

Parameters

navigation object
entityType object
collectionType object
changeTrackingStrategy object

Returns

string

NonUniqueRequiredDependentForeignKey(object?, object?)

The foreign key {foreignKeyProperties} on the entity type '{declaringEntityType}' cannot have a required dependent end since it is not unique.

public static string NonUniqueRequiredDependentForeignKey(object? foreignKeyProperties, object? declaringEntityType)

Parameters

foreignKeyProperties object
declaringEntityType object

Returns

string

NonUniqueRequiredDependentNavigation(object?, object?)

'{principalEntityType}.{principalNavigation}' cannot be configured as required since it was configured as a collection.

public static string NonUniqueRequiredDependentNavigation(object? principalEntityType, object? principalNavigation)

Parameters

principalEntityType object
principalNavigation object

Returns

string

NotAProviderService(object?)

The database provider attempted to register an implementation of the '{service}' service. This is a service defined by Entity Framework and as such must not be registered using the 'TryAddProviderSpecificServices' method.

public static string NotAProviderService(object? service)

Parameters

service object

Returns

string

NotAnEFService(object?)

The database provider attempted to register an implementation of the '{service}' service. This is not a service defined by Entity Framework and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method.

public static string NotAnEFService(object? service)

Parameters

service object

Returns

string

NotAssignableClrBaseType(object?, object?, object?, object?)

The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{clrType}' is not a descendant of '{baseClrType}'.

public static string NotAssignableClrBaseType(object? entityType, object? baseEntityType, object? clrType, object? baseClrType)

Parameters

entityType object
baseEntityType object
clrType object
baseClrType object

Returns

string

NotCollection(object?, object?)

The property '{entityType}.{property}' cannot be mapped as a collection since it does not implement 'IEnumerable<T>'.

public static string NotCollection(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

NullRequiredComplexProperty(object?, object?)

The complex type property '{type}.{property}' is configured as required (non-nullable) but has a null value when saving changes. Only non-null complex properties are supported by EF Core 8.

public static string NullRequiredComplexProperty(object? type, object? property)

Parameters

type object
property object

Returns

string

NullRequiredPrimitiveCollection(object?, object?)

The primitive collection property '{type}.{property}' is configured as required (non-nullable) but has a null value when saving changes. Either mark the property as optional (nullable) or set a non-null value.

public static string NullRequiredPrimitiveCollection(object? type, object? property)

Parameters

type object
property object

Returns

string

NullableKey(object?, object?)

A key on entity type '{entityType}' cannot contain the property '{property}' because it is nullable/optional. All properties on which a key is declared must be marked as non-nullable/required.

public static string NullableKey(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

OptionsExtensionNotFound(object?)

Options extension of type '{optionsExtension}' not found.

public static string OptionsExtensionNotFound(object? optionsExtension)

Parameters

optionsExtension object

Returns

string

OriginalValueNotTracked(object?, object?)

The original value for property '{1_entityType}.{0_property}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values, use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'.

public static string OriginalValueNotTracked(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

OwnedDerivedType(object?)

The owned entity type '{entityType}' cannot have a base type. See https://aka.ms/efcore-docs-owned for more information.

public static string OwnedDerivedType(object? entityType)

Parameters

entityType object

Returns

string

OwnerlessOwnedType(object?)

The entity type '{ownedType}' has been marked as owned and must be referenced from another entity type via a navigation. Add a navigation to an entity type that points at '{ownedType}' or don't configure it as owned.

public static string OwnerlessOwnedType(object? ownedType)

Parameters

ownedType object

Returns

string

OwnershipToDependent(object?, object?, object?)

The navigation '{navigation}' cannot be changed, because the foreign key between '{principalEntityType}' and '{dependentEntityType}' is an ownership. To change the navigation to the owned entity type remove the ownership.

public static string OwnershipToDependent(object? navigation, object? principalEntityType, object? dependentEntityType)

Parameters

navigation object
principalEntityType object
dependentEntityType object

Returns

string

PoolingContextCtorError(object?)

The DbContext of type '{contextType}' cannot be pooled because it does not have a public constructor accepting a single parameter of type DbContextOptions or has more than one constructor.

public static string PoolingContextCtorError(object? contextType)

Parameters

contextType object

Returns

string

PrimaryKeyAttributeOnDerivedEntity(object?, object?)

The derived type '{derivedType}' cannot have the [PrimaryKey] attribute since primary keys may only be declared on the root type. Move the attribute to '{rootType}', or remove '{rootType}' from the model by using [NotMapped] attribute or calling 'EntityTypeBuilder.Ignore' on the base type in 'OnModelCreating'.

public static string PrimaryKeyAttributeOnDerivedEntity(object? derivedType, object? rootType)

Parameters

derivedType object
rootType object

Returns

string

PrimaryKeyDefinedOnIgnoredProperty(object?, object?)

The [PrimaryKey] attribute on the entity type '{entityType}' is invalid because the property '{propertyName}' was marked as unmapped by [NotMapped] attribute or 'Ignore()' in 'OnModelCreating'. A primary key cannot use unmapped properties.

public static string PrimaryKeyDefinedOnIgnoredProperty(object? entityType, object? propertyName)

Parameters

entityType object
propertyName object

Returns

string

PrimaryKeyDefinedOnNonExistentProperty(object?, object?, object?)

The [PrimaryKey] attribute on the entity type '{entityType}' references properties {properties}, but no property with name '{propertyName}' exists on that entity type or any of its base types.

public static string PrimaryKeyDefinedOnNonExistentProperty(object? entityType, object? properties, object? propertyName)

Parameters

entityType object
properties object
propertyName object

Returns

string

PrincipalEndIncompatibleNavigations(object?, object?, object?)

When creating the relationship between '{navigationSpecification1}' and '{navigationSpecification2}' the entity type '{targetEntityType}' cannot be set as principal.

public static string PrincipalEndIncompatibleNavigations(object? navigationSpecification1, object? navigationSpecification2, object? targetEntityType)

Parameters

navigationSpecification1 object
navigationSpecification2 object
targetEntityType object

Returns

string

PrincipalEntityTypeNotInRelationship(object?, object?, object?)

You are configuring a relationship between '{dependentEntityType}' and '{principalEntityType}', but have specified a principal key on '{entityType}'. The foreign key must target a type that is part of the relationship.

public static string PrincipalEntityTypeNotInRelationship(object? dependentEntityType, object? principalEntityType, object? entityType)

Parameters

dependentEntityType object
principalEntityType object
entityType object

Returns

string

PrincipalKeylessType(object?, object?, object?)

The keyless entity type '{entityType}' cannot be on the principal end of the relationship between '{firstNavigationSpecification}' and '{secondNavigationSpecification}'. The principal entity type must have a key. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.

public static string PrincipalKeylessType(object? entityType, object? firstNavigationSpecification, object? secondNavigationSpecification)

Parameters

entityType object
firstNavigationSpecification object
secondNavigationSpecification object

Returns

string

PrincipalOwnedType(object?, object?, object?)

The relationship from '{referencingEntityTypeOrNavigation}' to '{referencedEntityTypeOrNavigation}' is not supported because the owned entity type '{ownedType}' cannot be on the principal side of a non-ownership relationship. Remove the relationship or configure the foreign key to be on '{ownedType}'.

public static string PrincipalOwnedType(object? referencingEntityTypeOrNavigation, object? referencedEntityTypeOrNavigation, object? ownedType)

Parameters

referencingEntityTypeOrNavigation object
referencedEntityTypeOrNavigation object
ownedType object

Returns

string

PropertyClashingNonIndexer(object?, object?)

The indexer property '{property}' cannot be added to the type '{type}' because the CLR type contains a member with the same name. Specify a different name or configure '{property}' as a non-indexer property.

public static string PropertyClashingNonIndexer(object? property, object? type)

Parameters

property object
type object

Returns

string

PropertyConceptualNull(object?, object?)

The property '{1_entityType}.{0_property}' contains null, but the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values.

public static string PropertyConceptualNull(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

PropertyConceptualNullSensitive(object?, object?, object?)

The property '{property}' contains null on entity '{entityType}' with the key value '{keyValue}', but the property is marked as required.

public static string PropertyConceptualNullSensitive(object? property, object? entityType, object? keyValue)

Parameters

property object
entityType object
keyValue object

Returns

string

PropertyDoesNotBelong(object?, object?, object?)

The property '{property}' belongs to the type '{expectedType}', but is being used with an instance of type '{actualType}'.

public static string PropertyDoesNotBelong(object? property, object? expectedType, object? actualType)

Parameters

property object
expectedType object
actualType object

Returns

string

PropertyInUseForeignKey(object?, object?, object?, object?)

The property '{property}' cannot be removed from the type '{type}' because it is being used in the foreign key {foreignKeyProperties} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed.

public static string PropertyInUseForeignKey(object? property, object? type, object? foreignKeyProperties, object? foreignKeyType)

Parameters

property object
type object
foreignKeyProperties object
foreignKeyType object

Returns

string

PropertyInUseIndex(object?, object?, object?, object?)

The property '{property}' cannot be removed from the type '{entityType}' because it is being used in the index {index} on '{indexType}'. All containing indexes must be removed or redefined before the property can be removed.

public static string PropertyInUseIndex(object? property, object? entityType, object? index, object? indexType)

Parameters

property object
entityType object
index object
indexType object

Returns

string

PropertyInUseKey(object?, object?, object?)

The property '{property}' cannot be removed from the type '{entityType}' because it is being used in the key {keyProperties}. All containing keys must be removed or redefined before the property can be removed.

public static string PropertyInUseKey(object? property, object? entityType, object? keyProperties)

Parameters

property object
entityType object
keyProperties object

Returns

string

PropertyNotAdded(object?, object?, object?)

The property '{entityType}.{property}' could not be mapped because it is of type '{propertyType}', which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

public static string PropertyNotAdded(object? entityType, object? property, object? propertyType)

Parameters

entityType object
property object
propertyType object

Returns

string

PropertyNotAddedAdHoc(object?, object?, object?)

The property '{entityType}.{property}' could not be mapped because it is of type '{propertyType}', which is not a supported primitive type or a valid entity type. The property can be ignored using the '[NotMapped]' attribute.

public static string PropertyNotAddedAdHoc(object? entityType, object? property, object? propertyType)

Parameters

entityType object
property object
propertyType object

Returns

string

PropertyNotFound(object?, object?)

The property '{1_entityType}.{0_property}' could not be found. Ensure that the property exists and has been included in the model.

public static string PropertyNotFound(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

PropertyNotMapped(object?, object?, object?)

The '{propertyType}' property '{entityType}.{property}' could not be mapped because the database provider does not support this type. Consider converting the property value to a type supported by the database using a value converter. See https://aka.ms/efcore-docs-value-converters for more information. Alternately, exclude the property from the model using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

public static string PropertyNotMapped(object? propertyType, object? entityType, object? property)

Parameters

propertyType object
entityType object
property object

Returns

string

PropertyReadOnlyAfterSave(object?, object?)

The property '{1_entityType}.{0_property}' is defined as read-only after it has been saved, but its value has been modified or marked as modified.

public static string PropertyReadOnlyAfterSave(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

PropertyReadOnlyBeforeSave(object?, object?)

The property '{1_entityType}.{0_property}' is defined as read-only before it has been saved, but its value has been set to something other than a temporary or default value.

public static string PropertyReadOnlyBeforeSave(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

PropertyWrongClrType(object?, object?, object?, object?)

The property '{property}' cannot be added to the type '{type}' because the type of the corresponding CLR property or field '{clrType}' does not match the specified type '{propertyType}'.

public static string PropertyWrongClrType(object? property, object? type, object? clrType, object? propertyType)

Parameters

property object
type object
clrType object
propertyType object

Returns

string

PropertyWrongEntityClrType(object?, object?, object?)

The property '{property}' cannot be added to the type '{type}' because it is declared on the CLR type '{clrType}'.

public static string PropertyWrongEntityClrType(object? property, object? type, object? clrType)

Parameters

property object
type object
clrType object

Returns

string

PropertyWrongName(object?, object?, object?)

The property '{property}' cannot be added to the type '{type}' because it doesn't match the name of the provided CLR property or field '{clrName}'. Use the same name or specify a different CLR member.

public static string PropertyWrongName(object? property, object? type, object? clrName)

Parameters

property object
type object
clrName object

Returns

string

PropertyWrongType(object?, object?, object?)

The property '{property}' cannot be removed from the type '{type}' because it is declared on the '{otherType}' type.

public static string PropertyWrongType(object? property, object? type, object? otherType)

Parameters

property object
type object
otherType object

Returns

string

QueryEntityMaterializationConditionWrongShape(object?)

The materialization condition passed for entity shaper of entity type '{entityType}' is not of the correct shape. A materialization condition must be a 'LambdaExpression' of 'Func<ValueBuffer, IEntityType>'.

public static string QueryEntityMaterializationConditionWrongShape(object? entityType)

Parameters

entityType object

Returns

string

QueryInvalidMaterializationType(object?, object?)

The query contains a projection '{projection}' of type '{queryableType}'. Collections in the final projection must be an 'IEnumerable<T>' type such as 'List<T>'. Consider using 'ToList' or some other mechanism to convert the 'IQueryable<T>' or 'IOrderedEnumerable<T>' into an 'IEnumerable<T>'.

public static string QueryInvalidMaterializationType(object? projection, object? queryableType)

Parameters

projection object
queryableType object

Returns

string

QueryRootDifferentEntityType(object?)

The replacement entity type: {entityType} does not have same name and CLR type as entity type this query root represents.

public static string QueryRootDifferentEntityType(object? entityType)

Parameters

entityType object

Returns

string

QueryUnableToTranslateEFProperty(object?)

Translation of '{expression}' failed. Either the query source is not an entity type, or the specified property does not exist on the entity type.

public static string QueryUnableToTranslateEFProperty(object? expression)

Parameters

expression object

Returns

string

QueryUnableToTranslateMember(object?, object?)

Translation of member '{member}' on entity type '{entityType}' failed. This commonly occurs when the specified member is unmapped.

public static string QueryUnableToTranslateMember(object? member, object? entityType)

Parameters

member object
entityType object

Returns

string

QueryUnableToTranslateMethod(object?, object?)

Translation of method '{declaringTypeName}.{methodName}' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information.

public static string QueryUnableToTranslateMethod(object? declaringTypeName, object? methodName)

Parameters

declaringTypeName object
methodName object

Returns

string

QueryUnhandledQueryRootExpression(object?)

Query root of type '{type}' wasn't handled by provider code. This issue happens when using a provider specific method on a different provider where it is not supported.

public static string QueryUnhandledQueryRootExpression(object? type)

Parameters

type object

Returns

string

ReadOnlyListType(object?)

The type '{givenType}' cannot be used as a primitive collection because it is read-only. Read-only collections of primitive types are not supported.

public static string ReadOnlyListType(object? givenType)

Parameters

givenType object

Returns

string

ReferenceIsCollection(object?, object?, object?, object?)

The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' method, but is defined in the model as a collection navigation. Use the '{collectionMethod}' method to access collection navigations.

public static string ReferenceIsCollection(object? property, object? entityType, object? referenceMethod, object? collectionMethod)

Parameters

property object
entityType object
referenceMethod object
collectionMethod object

Returns

string

ReferenceMustBeLoaded(object?, object?)

The navigation '{1_entityType}.{0_navigation}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and is therefore loaded.

public static string ReferenceMustBeLoaded(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

ReferencedShadowKey(object?, object?, object?, object?)

The relationship from '{referencingEntityTypeOrNavigation}' to '{referencedEntityTypeOrNavigation}' with foreign key properties {foreignKeyPropertiesWithTypes} cannot target the primary key {primaryKeyPropertiesWithTypes} because it is not compatible. Configure a principal key or a set of foreign key properties with compatible types for this relationship.

public static string ReferencedShadowKey(object? referencingEntityTypeOrNavigation, object? referencedEntityTypeOrNavigation, object? foreignKeyPropertiesWithTypes, object? primaryKeyPropertiesWithTypes)

Parameters

referencingEntityTypeOrNavigation object
referencedEntityTypeOrNavigation object
foreignKeyPropertiesWithTypes object
primaryKeyPropertiesWithTypes object

Returns

string

RelationshipConceptualNull(object?, object?)

The association between entity types '{firstType}' and '{secondType}' has been severed, but the relationship is either marked as required or is implicitly required because the foreign key is not nullable. If the dependent/child entity should be deleted when a required relationship is severed, configure the relationship to use cascade deletes. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values.

public static string RelationshipConceptualNull(object? firstType, object? secondType)

Parameters

firstType object
secondType object

Returns

string

RelationshipConceptualNullSensitive(object?, object?, object?)

The association between entities '{firstType}' and '{secondType}' with the key value '{secondKeyValue}' has been severed, but the relationship is either marked as required or is implicitly required because the foreign key is not nullable. If the dependent/child entity should be deleted when a required relationship is severed, configure the relationship to use cascade deletes.

public static string RelationshipConceptualNullSensitive(object? firstType, object? secondType, object? secondKeyValue)

Parameters

firstType object
secondType object
secondKeyValue object

Returns

string

RelationshipCycle(object?, object?, object?)

A relationship cycle involving the property '{entityType}.{property}' was detected. This prevents Entity Framework from determining the correct configuration. Review the foreign keys defined on the property and the corresponding principal property and either remove one of them or specify '{configuration}' explicitly on one of the properties.

public static string RelationshipCycle(object? entityType, object? property, object? configuration)

Parameters

entityType object
property object
configuration object

Returns

string

RequiredSkipNavigation(object?, object?)

'{entityType}.{navigation}' cannot be configured as required since it represents a skip navigation.

public static string RequiredSkipNavigation(object? entityType, object? navigation)

Parameters

entityType object
navigation object

Returns

string

RetryLimitExceeded(object?, object?)

The maximum number of retries ({retryLimit}) was exceeded while executing database operations with '{strategy}'. See the inner exception for the most recent failure.

public static string RetryLimitExceeded(object? retryLimit, object? strategy)

Parameters

retryLimit object
strategy object

Returns

string

SameParameterInstanceUsedInMultipleLambdas(object?)

The same parameter instance with name '{parameterName}' was used in multiple lambdas in the query tree. Each lambda must have its own parameter instances.

public static string SameParameterInstanceUsedInMultipleLambdas(object? parameterName)

Parameters

parameterName object

Returns

string

SaveOwnedWithoutOwner(object?)

Cannot save instance of '{entityType}' because it is an owned entity without any reference to its owner. Owned entities can only be saved as part of an aggregate also including the owner entity.

public static string SaveOwnedWithoutOwner(object? entityType)

Parameters

entityType object

Returns

string

SeedDatumComplexProperty(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because it has the complex property '{property}' set. Complex properties are currently not supported in seeding. See https://github.com/dotnet/efcore/issues/31254 for more information. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the involved property values.

public static string SeedDatumComplexProperty(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

SeedDatumComplexPropertySensitive(object?, object?, object?)

The seed entity for entity type '{entityType}' with the key value '{keyValue}' cannot be added because it has the complex property '{property}' set. Complex properties are currently not supported in seeding. See https://github.com/dotnet/efcore/issues/31254 for more information.

public static string SeedDatumComplexPropertySensitive(object? entityType, object? keyValue, object? property)

Parameters

entityType object
keyValue object
property object

Returns

string

SeedDatumDefaultValue(object?, object?, object?)

The seed entity for entity type '{entityType}' cannot be added because a default value was provided for the required property '{property}'. Please provide a value different from '{defaultValue}'.

public static string SeedDatumDefaultValue(object? entityType, object? property, object? defaultValue)

Parameters

entityType object
property object
defaultValue object

Returns

string

SeedDatumDerivedType(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because the value provided is of a derived type '{derivedType}'. Add the derived seed entities to the corresponding entity type.

public static string SeedDatumDerivedType(object? entityType, object? derivedType)

Parameters

entityType object
derivedType object

Returns

string

SeedDatumDuplicate(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because another seed entity with the same key value for {keyProperties} has already been added. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

public static string SeedDatumDuplicate(object? entityType, object? keyProperties)

Parameters

entityType object
keyProperties object

Returns

string

SeedDatumDuplicateSensitive(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because another seed entity with the key value '{keyValue}' has already been added.

public static string SeedDatumDuplicateSensitive(object? entityType, object? keyValue)

Parameters

entityType object
keyValue object

Returns

string

SeedDatumIncompatibleValue(object?, object?, object?)

The seed entity for entity type '{entityType}' cannot be added because the value provided for the property '{property}' is not compatible with the property type '{type}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the involved property value.

public static string SeedDatumIncompatibleValue(object? entityType, object? property, object? type)

Parameters

entityType object
property object
type object

Returns

string

SeedDatumIncompatibleValueSensitive(object?, object?, object?, object?)

The seed entity for entity type '{entityType}' cannot be added because the value '{value}' provided for the property '{property}' is not compatible with the property type '{type}'.

public static string SeedDatumIncompatibleValueSensitive(object? entityType, object? value, object? property, object? type)

Parameters

entityType object
value object
property object
type object

Returns

string

SeedDatumMissingValue(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because no value was provided for the required property '{property}'.

public static string SeedDatumMissingValue(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

SeedDatumNavigation(object?, object?, object?, object?)

The seed entity for entity type '{entityType}' cannot be added because it has the navigation '{navigation}' set. To seed relationships, add the entity seed to '{relatedEntityType}' and specify the foreign key values {foreignKeyProperties}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the involved property values.

public static string SeedDatumNavigation(object? entityType, object? navigation, object? relatedEntityType, object? foreignKeyProperties)

Parameters

entityType object
navigation object
relatedEntityType object
foreignKeyProperties object

Returns

string

SeedDatumNavigationSensitive(object?, object?, object?, object?, object?)

The seed entity for entity type '{entityType}' with the key value '{keyValue}' cannot be added because it has the navigation '{navigation}' set. To seed relationships, add the entity seed to '{relatedEntityType}' and specify the foreign key values {foreignKeyProperties}.

public static string SeedDatumNavigationSensitive(object? entityType, object? keyValue, object? navigation, object? relatedEntityType, object? foreignKeyProperties)

Parameters

entityType object
keyValue object
navigation object
relatedEntityType object
foreignKeyProperties object

Returns

string

SeedDatumSignedNumericValue(object?, object?)

The seed entity for entity type '{entityType}' cannot be added because a non-zero value is required for property '{property}'. Consider providing a negative value to avoid collisions with non-seed data.

public static string SeedDatumSignedNumericValue(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

SeedKeylessEntity(object?)

The seed entity for entity type '{entityType}' cannot be added because keyless entity types are not supported. Consider providing a key or removing the seed data.

public static string SeedKeylessEntity(object? entityType)

Parameters

entityType object

Returns

string

SelfReferencingNavigationWithInverseProperty(object?, object?)

The inverse for the navigation '{entityType}.{property}' cannot be the same navigation. Change the value in the [InverseProperty] attribute to a different navigation.

public static string SelfReferencingNavigationWithInverseProperty(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

ServiceProviderConfigAdded(object?)

configuration added for '{key}'

public static string ServiceProviderConfigAdded(object? key)

Parameters

key object

Returns

string

ServiceProviderConfigChanged(object?)

configuration changed for '{key}'

public static string ServiceProviderConfigChanged(object? key)

Parameters

key object

Returns

string

ServiceProviderConfigRemoved(object?)

configuration removed for '{key}'

public static string ServiceProviderConfigRemoved(object? key)

Parameters

key object

Returns

string

SharedTypeDerivedType(object?)

The shared-type entity type '{entityType}' cannot have a base type.

public static string SharedTypeDerivedType(object? entityType)

Parameters

entityType object

Returns

string

SingletonOptionChanged(object?, object?)

A call was made to '{optionCall}' that changed an option that must be constant within a service provider, but Entity Framework is not building its own internal service provider. Either allow Entity Framework to build the service provider by removing the call to '{useInternalServiceProvider}', or ensure that the configuration for '{optionCall}' does not change for all uses of a given service provider passed to '{useInternalServiceProvider}'.

public static string SingletonOptionChanged(object? optionCall, object? useInternalServiceProvider)

Parameters

optionCall object
useInternalServiceProvider object

Returns

string

SingletonRequired(object?, object?)

An attempt was made to register an instance for the '{scope}' service '{service}'. Instances can only be registered for 'Singleton' services.

public static string SingletonRequired(object? scope, object? service)

Parameters

scope object
service object

Returns

string

SkipInverseMismatchedForeignKey(object?, object?, object?, object?, object?)

The foreign key {foreignKeyProperties} cannot be set for the skip navigation '{navigation}' as it uses the join entity type '{joinType}' while the inverse skip navigation '{inverse}' is associated with a foreign key using the join entity type '{inverseJoinType}'. The inverse navigation must use the same join entity type.

public static string SkipInverseMismatchedForeignKey(object? foreignKeyProperties, object? navigation, object? joinType, object? inverse, object? inverseJoinType)

Parameters

foreignKeyProperties object
navigation object
joinType object
inverse object
inverseJoinType object

Returns

string

SkipInverseMismatchedJoinType(object?, object?, object?, object?)

The skip navigation '{inverse}' using the join entity type '{inverseJoinType}' cannot be set as the inverse of '{navigation}', which uses the join entity type '{joinType}'. The inverse navigation must use the same join entity type.

public static string SkipInverseMismatchedJoinType(object? inverse, object? inverseJoinType, object? navigation, object? joinType)

Parameters

inverse object
inverseJoinType object
navigation object
joinType object

Returns

string

SkipNavigationForeignKeyWrongDependentType(object?, object?, object?, object?)

The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{entityType}.{navigation}' because it is declared on the entity type '{dependentEntityType}', but a foreign key on '{entityType}' is expected.

public static string SkipNavigationForeignKeyWrongDependentType(object? foreignKeyProperties, object? entityType, object? navigation, object? dependentEntityType)

Parameters

foreignKeyProperties object
entityType object
navigation object
dependentEntityType object

Returns

string

SkipNavigationForeignKeyWrongPrincipalType(object?, object?, object?, object?)

The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{entityType}.{navigation}' because it is declared on the entity type '{entityType}', but a foreign key on '{principalEntityType}' is expected.

public static string SkipNavigationForeignKeyWrongPrincipalType(object? foreignKeyProperties, object? entityType, object? navigation, object? principalEntityType)

Parameters

foreignKeyProperties object
entityType object
navigation object
principalEntityType object

Returns

string

SkipNavigationInUseBySkipNavigation(object?, object?, object?, object?)

The skip navigation '{entityType}.{skipNavigation}' cannot be removed because it is configured as the inverse of the skip navigation '{referencingEntityType}.{inverseSkipNavigation}'. All referencing skip navigations must be removed before this skip navigation can be removed.

public static string SkipNavigationInUseBySkipNavigation(object? entityType, object? skipNavigation, object? referencingEntityType, object? inverseSkipNavigation)

Parameters

entityType object
skipNavigation object
referencingEntityType object
inverseSkipNavigation object

Returns

string

SkipNavigationNoForeignKey(object?, object?)

The skip navigation '{1_entityType}.{0_navigation}' doesn't have a foreign key associated with it. Every skip navigation must have a configured foreign key.

public static string SkipNavigationNoForeignKey(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

SkipNavigationNoInverse(object?, object?)

The skip navigation '{1_entityType}.{0_navigation}' doesn't have an inverse navigation configured. Every skip navigation should have an inverse skip navigation.

public static string SkipNavigationNoInverse(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

SkipNavigationNonCollection(object?, object?)

The skip navigation '{1_entityType}.{0_navigation}' is not a collection. Only collection skip navigations are currently supported.

public static string SkipNavigationNonCollection(object? navigation, object? entityType)

Parameters

navigation object
entityType object

Returns

string

SkipNavigationWrongInverse(object?, object?, object?, object?)

The skip navigation '{inverse}' declared on the entity type '{inverseEntityType}' cannot be set as the inverse of '{navigation}', which targets '{targetEntityType}'. The inverse navigation should be declared on the target entity type.

public static string SkipNavigationWrongInverse(object? inverse, object? inverseEntityType, object? navigation, object? targetEntityType)

Parameters

inverse object
inverseEntityType object
navigation object
targetEntityType object

Returns

string

SkipNavigationWrongType(object?, object?, object?)

The skip navigation '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.

public static string SkipNavigationWrongType(object? navigation, object? entityType, object? otherEntityType)

Parameters

navigation object
entityType object
otherEntityType object

Returns

string

StoreGenValue(object?, object?)

The property '{1_entityType}.{0_property}' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values.

public static string StoreGenValue(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

TempValue(object?, object?)

The property '{1_entityType}.{0_property}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values.

public static string TempValue(object? property, object? entityType)

Parameters

property object
entityType object

Returns

string

TempValuePersists(object?, object?, object?)

The property '{1_entityType}.{0_property}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly, or ensure that the database is configured to generate values for this property.

public static string TempValuePersists(object? property, object? entityType, object? state)

Parameters

property object
entityType object
state object

Returns

string

TrackingTypeMismatch(object?, object?)

The instance of entity type '{runtimeEntityType}' cannot be tracked as the entity type '{entityType}' because the two types are not in the same hierarchy.

public static string TrackingTypeMismatch(object? runtimeEntityType, object? entityType)

Parameters

runtimeEntityType object
entityType object

Returns

string

TranslationFailed(object?)

The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

public static string TranslationFailed(object? expression)

Parameters

expression object

Returns

string

TranslationFailedWithDetails(object?, object?)

The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

public static string TranslationFailedWithDetails(object? expression, object? details)

Parameters

expression object
details object

Returns

string

TypeConfigurationConflict(object?, object?, object?, object?)

The type '{type}' has been configured as '{typeConfiguration}', this conflicts with type '{otherType}' configured as '{otherTypeConfiguration}'. All base types and implemented interfaces must have the same configuration type.

public static string TypeConfigurationConflict(object? type, object? typeConfiguration, object? otherType, object? otherTypeConfiguration)

Parameters

type object
typeConfiguration object
otherType object
otherTypeConfiguration object

Returns

string

TypeNotMarkedAsShared(object?)

The type '{type}' has not been configured as a shared type in the model. Before calling 'UsingEntity' add the entity type in the model as a shared entity.

public static string TypeNotMarkedAsShared(object? type)

Parameters

type object

Returns

string

UnableToDiscriminate(object?, object?)

Unable to materialize entity instance of type '{entityType}'. No discriminators matched the discriminator value '{discriminator}'.

public static string UnableToDiscriminate(object? entityType, object? discriminator)

Parameters

entityType object
discriminator object

Returns

string

UnableToSetIsUnique(object?, object?, object?)

Unable to set 'IsUnique' to '{isUnique}' on the relationship associated with the navigation '{2_entityType}.{1_navigationName}' because the navigation has the opposite multiplicity.

public static string UnableToSetIsUnique(object? isUnique, object? navigationName, object? entityType)

Parameters

isUnique object
navigationName object
entityType object

Returns

string

UnconfigurableType(object?, object?, object?, object?)

The type '{type}' cannot be configured as '{configuration}' since model building assumes that it is configured as '{expectedConfiguration}'. Remove the unsupported configuration for '{configurationType}'.

public static string UnconfigurableType(object? type, object? configuration, object? expectedConfiguration, object? configurationType)

Parameters

type object
configuration object
expectedConfiguration object
configurationType object

Returns

string

UnconfigurableTypeMapping(object?)

Default type mapping cannot be configured for the type '{type}' since it's not a valid scalar type. Remove the unsupported configuration.

public static string UnconfigurableTypeMapping(object? type)

Parameters

type object

Returns

string

UnhandledExpressionNode(object?)

Unhandled expression node type '{nodeType}'.

public static string UnhandledExpressionNode(object? nodeType)

Parameters

nodeType object

Returns

string

UnhandledMemberBinding(object?)

Unhandled member binding type '{bindingType}'.

public static string UnhandledMemberBinding(object? bindingType)

Parameters

bindingType object

Returns

string

UnhandledNavigationBase(object?)

Unhandled 'INavigationBase' of type '{type}'.

public static string UnhandledNavigationBase(object? type)

Parameters

type object

Returns

string

UnknownEntity(object?)

Unhandled {entity} encountered.

public static string UnknownEntity(object? entity)

Parameters

entity object

Returns

string

UnknownKeyValue(object?, object?)

The value of '{entityType}.{property}' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known.

public static string UnknownKeyValue(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

UnknownShadowKeyValue(object?, object?)

The value of shadow key property '{entityType}.{property}' is unknown when attempting to save changes. This is because shadow property values cannot be preserved when the entity is not being tracked. Consider adding the property to the entity's .NET type. See https://aka.ms/efcore-docs-owned-collections for more information.

public static string UnknownShadowKeyValue(object? entityType, object? property)

Parameters

entityType object
property object

Returns

string

UnnamedIndexDefinedOnIgnoredProperty(object?, object?, object?)

The unnamed index specified via [Index] attribute on the entity type '{entityType}' with properties {indexProperties} is invalid. The property '{propertyName}' was marked as unmapped by [NotMapped] attribute or 'Ignore()' in 'OnModelCreating'. An index cannot use unmapped properties.

public static string UnnamedIndexDefinedOnIgnoredProperty(object? entityType, object? indexProperties, object? propertyName)

Parameters

entityType object
indexProperties object
propertyName object

Returns

string

UnnamedIndexDefinedOnNonExistentProperty(object?, object?, object?)

An unnamed index specified via [Index] attribute on the entity type '{entityType}' references properties {indexProperties}, but no property with name '{propertyName}' exists on that entity type or any of its base types.

public static string UnnamedIndexDefinedOnNonExistentProperty(object? entityType, object? indexProperties, object? propertyName)

Parameters

entityType object
indexProperties object
propertyName object

Returns

string

UntrackedDependentEntity(object?, object?, object?)

The entity type '{entityType}' uses a shared type and the supplied entity is currently not being tracked. To start tracking this entity, call '{referenceCall}' or '{collectionCall}' on the owner entry.

public static string UntrackedDependentEntity(object? entityType, object? referenceCall, object? collectionCall)

Parameters

entityType object
referenceCall object
collectionCall object

Returns

string

ValueCannotBeNull(object?, object?, object?)

The value for property '{1_entityType}.{0_property}' cannot be set to null because its type is '{propertyType}' which is not a nullable type.

public static string ValueCannotBeNull(object? property, object? entityType, object? propertyType)

Parameters

property object
entityType object
propertyType object

Returns

string

VisitIsNotAllowed(object?)

Calling '{visitMethodName}' is not allowed. Visit the expression manually for the relevant part in the visitor.

public static string VisitIsNotAllowed(object? visitMethodName)

Parameters

visitMethodName object

Returns

string

WarningAsErrorTemplate(object?, object?, object?)

An error was generated for warning '{eventName}': {message} This exception can be suppressed or logged by passing event ID '{eventId}' to the 'ConfigureWarnings' method in 'DbContext.OnConfiguring' or 'AddDbContext'.

public static string WarningAsErrorTemplate(object? eventName, object? message, object? eventId)

Parameters

eventName object
message object
eventId object

Returns

string

WrongGenericPropertyType(object?, object?, object?, object?)

Property '{1_entityType}.{0_property}' is of type '{actualType}' but the generic type provided is of type '{genericType}'.

public static string WrongGenericPropertyType(object? property, object? entityType, object? actualType, object? genericType)

Parameters

property object
entityType object
actualType object
genericType object

Returns

string

WrongStateManager(object?)

Cannot start tracking the entry for entity type '{entityType}' because it was created by a different StateManager instance.

public static string WrongStateManager(object? entityType)

Parameters

entityType object

Returns

string