Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@
<data name="IncompatibleViewNoRelationship" xml:space="preserve">
<value>Cannot use view '{view}' for entity type '{entityType}' since it is being used for entity type '{otherEntityType}' and there is no relationship between their primary keys.</value>
</data>
<data name="InconsistentNumberOfArguments" xml:space="preserve">
<value>'{name}' was constructed with {argumentCount} arguments, but the nullability was defined for {argumentNullabilityCount} arguments.</value>
</data>
<data name="IncorrectDefaultValueType" xml:space="preserve">
<value>Cannot set default value '{value}' of type '{valueType}' on property '{property}' of type '{propertyType}' in entity type '{entityType}'.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ public SqlFunctionExpression(
IsNullable = nullable;
InstancePropagatesNullability = instancePropagatesNullability;
ArgumentsPropagateNullability = argumentsPropagateNullability?.ToList();

if (Arguments?.Count != ArgumentsPropagateNullability?.Count)
{
throw new InvalidOperationException(
RelationalStrings.InconsistentNumberOfArguments(
name,
Arguments?.Count(),
ArgumentsPropagateNullability?.Count()
)
);
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public SqliteRandomTranslator(ISqlExpressionFactory sqlExpressionFactory)
_sqlExpressionFactory.Constant(9223372036854780000.0))
},
nullable: false,
argumentsPropagateNullability: Enumerable.Empty<bool>(),
argumentsPropagateNullability: [true],
method.ReturnType)
: null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public SqliteGeometryMemberTranslator(ISqlExpressionFactory sqlExpressionFactory
_sqlExpressionFactory.Constant(" ZM")
},
nullable: true,
argumentsPropagateNullability: new[] { true },
argumentsPropagateNullability: new[] { true, true },
returnType),
new[]
{
Expand Down Expand Up @@ -139,7 +139,7 @@ public SqliteGeometryMemberTranslator(ISqlExpressionFactory sqlExpressionFactory
_sqlExpressionFactory.Constant(" ZM")
},
nullable: true,
argumentsPropagateNullability: new[] { true },
argumentsPropagateNullability: new[] { true, true },
typeof(string)),
new[]
{
Expand Down