Skip to content

RevEng: Fix for issue #4168 (part 1) #4172

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 28, 2015
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
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Linq;
using JetBrains.Annotations;

namespace Microsoft.Data.Entity.Scaffolding
{
internal static class SqlServerTableSelectionSetExtensions
{
public static bool Allows(this TableSelectionSet _tableSelectionSet, [NotNull] string schemaName, [NotNull] string tableName)
public static bool Allows(this TableSelectionSet tableSelectionSet, [NotNull] string schemaName, [NotNull] string tableName)
{
if (_tableSelectionSet == null
|| (_tableSelectionSet.Schemas.Count == 0
&& _tableSelectionSet.Tables.Count == 0))
if ((tableSelectionSet == null)
|| ((tableSelectionSet.Schemas.Count == 0)
&& (tableSelectionSet.Tables.Count == 0)))
{
return true;
}

if (_tableSelectionSet.Schemas.Contains(schemaName))
if (tableSelectionSet.Schemas.Contains(schemaName))
{
return true;
}

return _tableSelectionSet.Tables.Contains($"{schemaName}.{tableName}")
|| _tableSelectionSet.Tables.Contains($"[{schemaName}].[{tableName}]")
|| _tableSelectionSet.Tables.Contains($"{schemaName}.[{tableName}]")
|| _tableSelectionSet.Tables.Contains($"[{schemaName}].{tableName}")
|| _tableSelectionSet.Tables.Contains($"{tableName}")
|| _tableSelectionSet.Tables.Contains($"[{tableName}]");
return tableSelectionSet.Tables.Contains($"{schemaName}.{tableName}", StringComparer.OrdinalIgnoreCase)
|| tableSelectionSet.Tables.Contains($"[{schemaName}].[{tableName}]", StringComparer.OrdinalIgnoreCase)
|| tableSelectionSet.Tables.Contains($"{schemaName}.[{tableName}]", StringComparer.OrdinalIgnoreCase)
|| tableSelectionSet.Tables.Contains($"[{schemaName}].{tableName}", StringComparer.OrdinalIgnoreCase)
|| tableSelectionSet.Tables.Contains($"{tableName}", StringComparer.OrdinalIgnoreCase)
|| tableSelectionSet.Tables.Contains($"[{tableName}]", StringComparer.OrdinalIgnoreCase);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ internal static class SqliteTableSelectionSetExtensions
{
public static bool Allows(this TableSelectionSet tableSet, string tableName)
{
if (tableSet == null
|| tableSet.Tables.Count == 0)
if ((tableSet == null)
|| (tableSet.Tables.Count == 0))
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static TableSelectionSet Filter
"OneToOneFKToUniqueKeyPrincipal",
"ReferredToByTableWithUnmappablePrimaryKeyColumn",
"TableWithUnmappablePrimaryKeyColumn",
"SelfReferencing",
"selfreferencing",
});

public SqlServerE2ETests(SqlServerE2EFixture fixture, ITestOutputHelper output)
Expand Down