dotnet/efcore · error · InvalidOperationException
The provider in use does not support partial updates with Ex
Error message
The provider in use does not support partial updates with ExecuteUpdate within JSON columns.
What it means
Default implementation of the protected virtual GenerateJsonPartialUpdateSetter hook. The base relational provider does not know how to emit the provider-specific JSON modification function (e.g. JSON_MODIFY), so any ExecuteUpdate that needs a partial JSON update on a provider that did not override this method throws.
Source
Thrown at src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.ExecuteUpdate.cs:923
/// <summary>
/// Provider extension point for implementing partial updates within JSON columns.
/// </summary>
/// <param name="target">
/// An expression representing the target to be updated; can be either <see cref="JsonScalarExpression" />
/// (when a scalar property is being updated within the JSON column), or a <see cref="JsonQueryExpression" />
/// (when an object or collection is being updated).
/// </param>
/// <param name="value">The JSON value to be set, ready for use as-is in <see cref="QuerySqlGenerator" />.</param>
/// <param name="existingSetterValue">
/// If a setter was previously created for this JSON column, it's value is passed here (this happens when e.g.
/// multiple properties are updated in the same JSON column). Implementations can compose the new setter into
/// the existing one (and return <see langword="null" />), or return a new one.
/// </param>
protected virtual SqlExpression? GenerateJsonPartialUpdateSetter(
Expression target,
SqlExpression value,
ref SqlExpression? existingSetterValue)
=> throw new InvalidOperationException(RelationalStrings.JsonPartialExecuteUpdateNotSupportedByProvider);
private static T? ParameterValueExtractor<T>(
QueryContext context,
string baseParameterName,
List<IComplexProperty>? complexPropertyChain,
IProperty property)
{
var baseValue = context.Parameters[baseParameterName];
if (complexPropertyChain is not null)
{
foreach (var complexProperty in complexPropertyChain)
{
if (baseValue is null)
{
break;
}
View on GitHub (pinned to 3a2006ef56)
Solutions
- Use a provider that overrides GenerateJsonPartialUpdateSetter (SQL Server/PostgreSQL with JSON support).
- Update the entire JSON column (not a nested path) if the provider supports whole-column set, or fall back to SaveChanges.
- Move the updatable scalar out of the JSON column into a regular column.
Defensive patterns
Strategy: validation
Validate before calling
// Check provider capability before attempting partial JSON ExecuteUpdate.
var isSupported = ctx.Database.ProviderName switch
{
"Microsoft.EntityFrameworkCore.SqlServer" => true,
_ => false
};
if (!isSupported)
throw new NotSupportedException("Provider does not support partial JSON ExecuteUpdate."); Prevention
- Confirm the provider overrides GenerateJsonPartialUpdateSetter before using JSON partial updates.
- Keep a compatibility matrix of providers vs JSON features.
- Fall back to SaveChanges or whole-column set for unsupported providers.
When it happens
Trigger: Calling ExecuteUpdate that targets a nested scalar within a JSON column on a provider that does not override GenerateJsonPartialUpdateSetter (e.g. a minimal/custom provider, or SQLite for certain JSON operations). The base method unconditionally throws.
Common situations: Using JSON columns with a provider whose JSON-update support is incomplete; upgrading a provider that has not yet implemented JSON partial updates.
Related errors
- '{operation}' used over owned type '{entityType}' which is m
- 'ExecuteUpdate' is being used over type '{structuralType}' w
- 'ExecuteUpdate' cannot currently set a property in a JSON co
- 'ExecuteUpdate' cannot currently set a property in a JSON co
- ExecuteUpdate over JSON columns is not supported when the co
AI-assisted analysis of dotnet/efcore@3a2006ef56 (2026-08-11).
Data as JSON: /api/errors/0c35017793c80509.
Report an issue: GitHub.