diff --git a/EFCore.VisualBasic/Design/Internal/VisualBasicHelper.vb b/EFCore.VisualBasic/Design/Internal/VisualBasicHelper.vb index 2679f6a..730fb9f 100644 --- a/EFCore.VisualBasic/Design/Internal/VisualBasicHelper.vb +++ b/EFCore.VisualBasic/Design/Internal/VisualBasicHelper.vb @@ -516,9 +516,9 @@ Namespace Design.Internal If valuesList.Count = 0 Then builder. - Append("New "). + Append("System.Array.Empty(Of "). Append(Reference(type)). - Append("() {}") + Append(")") Else Dim byteArray As Boolean diff --git a/Test/EFCore.VisualBasic.Test/Design/Internal/VisualBasicHelperTests.vb b/Test/EFCore.VisualBasic.Test/Design/Internal/VisualBasicHelperTests.vb index 36cd1da..eacd28d 100644 --- a/Test/EFCore.VisualBasic.Test/Design/Internal/VisualBasicHelperTests.vb +++ b/Test/EFCore.VisualBasic.Test/Design/Internal/VisualBasicHelperTests.vb @@ -112,7 +112,7 @@ Namespace Design.Internal Public Sub Literal_works_when_empty_ByteArray() Literal_works( New Byte() {}, - "New Byte() {}") + "System.Array.Empty(Of Byte)") End Sub @@ -350,7 +350,7 @@ $"multi-line{nl}string with """, Public Sub Literal_works_when_empty_StringArray() Dim literal = New VisualBasicHelper(TypeMappingSource).Literal(New String() {}) - Assert.Equal("New String() {}", literal) + Assert.Equal("System.Array.Empty(Of String)", literal) End Sub diff --git a/Test/EFCore.VisualBasic.Test/Migrations/Design/VisualBasicMigrationOperationGeneratorTest.vb b/Test/EFCore.VisualBasic.Test/Migrations/Design/VisualBasicMigrationOperationGeneratorTest.vb index faab255..7dde1ef 100644 --- a/Test/EFCore.VisualBasic.Test/Migrations/Design/VisualBasicMigrationOperationGeneratorTest.vb +++ b/Test/EFCore.VisualBasic.Test/Migrations/Design/VisualBasicMigrationOperationGeneratorTest.vb @@ -2624,7 +2624,7 @@ mb.Sql(""-- close to me"")" "mb.InsertData( table:=""People"", column:=""Tags"", - value:=New String() {})" + value:=System.Array.Empty(Of String))" Test(operation, expectedCode, @@ -2651,7 +2651,7 @@ mb.Sql(""-- close to me"")" "mb.InsertData( table:=""People"", columns:={""First Name"", ""Last Name"", ""Geometry""}, - values:=New Object() {""John"", Nothing, New String() {}})" + values:=New Object() {""John"", Nothing, System.Array.Empty(Of String)})" Test(operation, expectedCode, diff --git a/Test/EFCore.VisualBasic.Test/Scaffolding/Internal/VisualBasicRuntimeModelCodeGeneratorTest.vb b/Test/EFCore.VisualBasic.Test/Scaffolding/Internal/VisualBasicRuntimeModelCodeGeneratorTest.vb index bfedf44..ad4a7cf 100644 --- a/Test/EFCore.VisualBasic.Test/Scaffolding/Internal/VisualBasicRuntimeModelCodeGeneratorTest.vb +++ b/Test/EFCore.VisualBasic.Test/Scaffolding/Internal/VisualBasicRuntimeModelCodeGeneratorTest.vb @@ -38495,7 +38495,7 @@ Namespace TestNamespace } principalBaseTvfFunction.Columns.Add("ValueTypeList", valueTypeListFunctionColumn) relationalModel.Functions.Add( - ("PrincipalBaseTvf", "dbo", New String() {}), + ("PrincipalBaseTvf", "dbo", System.Array.Empty(Of String)), principalBaseTvfFunction) Dim principalBaseTvfFunctionMapping As New FunctionMapping(principalBase, principalBaseTvfFunction, principalBaseTvf, True) principalBaseTvfFunction.AddTypeMapping(principalBaseTvfFunctionMapping, False) @@ -44993,7 +44993,7 @@ Namespace TestNamespace } getAllDataFunction.Columns.Add("Blob", blobFunctionColumn) relationalModel.Functions.Add( - ("GetAllData", "dbo", New String() {}), + ("GetAllData", "dbo", System.Array.Empty(Of String)), getAllDataFunction) Dim getAllDataFunctionMapping As New FunctionMapping(data, getAllDataFunction, getAllData, True) getAllDataFunction.AddTypeMapping(getAllDataFunctionMapping, False) @@ -45030,7 +45030,7 @@ Namespace TestNamespace Dim getBlobs = DirectCast(Me.FindDbFunction("GetBlobs()"), IRuntimeDbFunction) Dim getBlobsFunction As New StoreFunction(getBlobs, relationalModel) relationalModel.Functions.Add( - ("GetBlobs", "dbo", New String() {}), + ("GetBlobs", "dbo", System.Array.Empty(Of String)), getBlobsFunction) Dim getBlobsFunctionMapping As New FunctionMapping([object], getBlobsFunction, getBlobs, True) getBlobsFunction.AddTypeMapping(getBlobsFunctionMapping, False)