From 71477e2eefad6c957d0733d3458af437b2bf4c8e Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Tue, 13 Aug 2024 22:06:46 +1000 Subject: [PATCH] use collection expressions in SqlServerByteArrayMethodTranslator --- .../Translators/SqlServerByteArrayMethodTranslator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs b/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs index 210c35a5d18..eecf04c1218 100644 --- a/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs @@ -53,9 +53,9 @@ public SqlServerByteArrayMethodTranslator(ISqlExpressionFactory sqlExpressionFac return _sqlExpressionFactory.GreaterThan( _sqlExpressionFactory.Function( "CHARINDEX", - new[] { value, source }, + [value, source], nullable: true, - argumentsPropagateNullability: new[] { true, true }, + argumentsPropagateNullability: [true, true], typeof(int)), _sqlExpressionFactory.Constant(0)); } @@ -67,9 +67,9 @@ public SqlServerByteArrayMethodTranslator(ISqlExpressionFactory sqlExpressionFac return _sqlExpressionFactory.Convert( _sqlExpressionFactory.Function( "SUBSTRING", - new[] { arguments[0], _sqlExpressionFactory.Constant(1), _sqlExpressionFactory.Constant(1) }, + [arguments[0], _sqlExpressionFactory.Constant(1), _sqlExpressionFactory.Constant(1)], nullable: true, - argumentsPropagateNullability: new[] { true, true, true }, + argumentsPropagateNullability: [true, true, true], typeof(byte[])), method.ReturnType); }