Skip to content

Commit

Permalink
Fix #23, allow using projects with .Tools NuGet installed instead of …
Browse files Browse the repository at this point in the history
….Design
  • Loading branch information
seclerp committed Dec 5, 2021
1 parent 2cacf27 commit 1e6e7a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dotnet/Rider.Plugins.EfCore/EfCoreHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ namespace Rider.Plugins.EfCore
{
public static class EfCoreHelper
{
private static readonly string EfCoreToolsNugetId = "Microsoft.EntityFrameworkCore.Design";
private static readonly string EfCoreDesignNugetId = "Microsoft.EntityFrameworkCore.Design";
private static readonly string EfCoreToolsNugetId = "Microsoft.EntityFrameworkCore.Tools";

public static IEnumerable<IProject> GetSupportedMigrationProjects(ISolution solution) =>
GetSupportedDotnetProjects(solution)
.Where(project => project.ProjectFileLocation.ExtensionNoDot == "csproj");

public static IEnumerable<IProject> GetSupportedStartupProjects(ISolution solution) =>
GetSupportedDotnetProjects(solution)
.Where(project => project.GetInstalledPackage(EfCoreToolsNugetId) != default);
.Where(project => project.GetInstalledPackage(EfCoreToolsNugetId) != default
|| project.GetInstalledPackage(EfCoreDesignNugetId) != default);

private static IEnumerable<IProject> GetSupportedDotnetProjects(ISolution solution) =>
solution
Expand Down

0 comments on commit 1e6e7a8

Please sign in to comment.