Repository: dotnet/efcore
File: src/dotnet-ef/Project.cs (C#)

Code before:
            TargetFrameworkMoniker = properties[nameof(TargetFrameworkMoniker)],
            Nullable = properties[nameof(Nullable)],
            TargetFramework = properties[nameof(TargetFramework)],
            TargetPlatformIdentifier = properties[nameof(TargetPlatformIdentifier)]
        };
    }

    private record class ProjectMetadata
    {
        public Dictionary<string, string> Properties { get; set; } = null!;
        public Dictionary<string, Dictionary<string, string>[]> Items { get; set; } = null!;
    }

    private static bool HasMultipleTargetFrameworks(string file)
    {
        var args = new List<string> { "msbuild", "/getProperty:TargetFrameworks", file };

        var output = new StringBuilder();
        var exitCode = Exe.Run("dotnet", args, handleOutput: line => output.AppendLine(line));
        if (exitCode != 0)
        {
            return false;
        }

        var outputString = output.ToString();
        return !string.IsNullOrEmpty(outputString) && !outputString.IsWhiteSpace();
    }

    private static void CopyBuildHost(
        Dictionary<string, string>[] runtimeCopyLocalItems,
        string targetDir)
    {
        var msbuildWorkspacesItem = runtimeCopyLocalItems.FirstOrDefault(item =>
            string.Equals(item["Filename"], "Microsoft.CodeAnalysis.Workspaces.MSBuild", StringComparison.OrdinalIgnoreCase));

        if (msbuildWorkspacesItem == null
            || !msbuildWorkspacesItem.TryGetValue("CopyLocal", out var copyLocal)
            || !string.Equals(copyLocal, "true", StringComparison.OrdinalIgnoreCase)
            || !msbuildWorkspacesItem.TryGetValue("FullPath", out var fullPath)
            || string.IsNullOrEmpty(fullPath))
        {
            return;
        }

        var contentFilesPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, "..", "..", "contentFiles", "any", "any"));
            CopyDirectoryRecursive(contentFilesPath, targetDir);
    }

    private static void CopyDirectoryRecursive(string sourceDir, string targetDir)
    {
        var directory = new DirectoryInfo(sourceDir);

Review comment (suggestion):
`IsWhiteSpace()` is not a valid method on the `string` type. The standard library provides `string.IsNullOrWhiteSpace(string value)` as a static method, not an instance method. This line should be:
```csharp
return !string.IsNullOrWhiteSpace(outputString);
```
Note that this also simplifies the logic since `IsNullOrWhiteSpace` already checks for both null/empty and whitespace.
```suggestion
        return !string.IsNullOrWhiteSpace(outputString);
```

Code after:
            TargetFrameworkMoniker = properties[nameof(TargetFrameworkMoniker)],
            Nullable = properties[nameof(Nullable)],
            TargetFramework = properties[nameof(TargetFramework)],
            TargetPlatformIdentifier = properties[nameof(TargetPlatformIdentifier)]
        };
    }

    private record class ProjectMetadata
    {
        public Dictionary<string, string> Properties { get; set; } = null!;
        public Dictionary<string, Dictionary<string, string>[]> Items { get; set; } = null!;
    }

    private static bool HasMultipleTargetFrameworks(string file)
    {
        var args = new List<string> { "msbuild", "/getProperty:TargetFrameworks", file };

        var output = new StringBuilder();
        var exitCode = Exe.Run("dotnet", args, handleOutput: line => output.AppendLine(line));
        if (exitCode != 0)
        {
            return false;
        }

        var outputString = output.ToString();
        return !string.IsNullOrWhiteSpace(outputString);
    }

    private static void CopyBuildHost(
        Dictionary<string, string>[] runtimeCopyLocalItems,
        string targetDir)
    {
        var msbuildWorkspacesItem = runtimeCopyLocalItems.FirstOrDefault(item =>
            string.Equals(item["Filename"], "Microsoft.CodeAnalysis.Workspaces.MSBuild", StringComparison.OrdinalIgnoreCase));

        if (msbuildWorkspacesItem == null
            || !msbuildWorkspacesItem.TryGetValue("CopyLocal", out var copyLocal)
            || !string.Equals(copyLocal, "true", StringComparison.OrdinalIgnoreCase)
            || !msbuildWorkspacesItem.TryGetValue("FullPath", out var fullPath)
            || string.IsNullOrEmpty(fullPath))
        {
            return;
        }

        var contentFilesPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, "..", "..", "contentFiles", "any", "any"));
            CopyDirectoryRecursive(contentFilesPath, targetDir);
    }

    private static void CopyDirectoryRecursive(string sourceDir, string targetDir)
    {
        var directory = new DirectoryInfo(sourceDir);