Skip to content

Commit 2ffc975

Browse files
committed
Make Program public so tests can access it
Rather than using IVT
1 parent 302c56d commit 2ffc975

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/MinimalApiPlayground/MinimalApiPlayground.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@
2323
<PackageReference Include="System.Runtime.Experimental" Version="6.0.0-*" />
2424
</ItemGroup>
2525

26-
<ItemGroup>
27-
<InternalsVisibleTo Include="MinimalApiPlayground.Tests" />
28-
</ItemGroup>
29-
3026
</Project>

src/MinimalApiPlayground/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,13 @@ public class TodoBinder : IParameterBinder<Todo>
441441
}
442442
}
443443

444-
class TodoDb : DbContext
444+
public class TodoDb : DbContext
445445
{
446446
public TodoDb(DbContextOptions<TodoDb> options)
447447
: base(options) { }
448448

449449
public DbSet<Todo> Todos => Set<Todo>();
450450
}
451+
452+
// Make the implicit Program class public so test projects can access it
453+
public partial class Program { }

src/Todo.Dapper/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,5 @@ public class Todo
131131
public string? Title { get; set; }
132132
public bool IsComplete { get; set; }
133133
}
134+
135+
public partial class Program { }

src/Todo.Dapper/Todo.Dapper.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@
1313
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.0-rc.1.*" />
1414
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.0.6" />
1515
</ItemGroup>
16-
17-
<ItemGroup>
18-
<InternalsVisibleTo Include="Todo.Dapper.Tests" />
19-
</ItemGroup>
2016
</Project>

0 commit comments

Comments
 (0)