Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit 56ba1d6

Browse files
Register controllers as services
1 parent 3ec3523 commit 56ba1d6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/AspNetCore/Contributions/MvcContribution.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ public class AspNetCoreConvention : IServiceConvention
2727
/// TODO Edit XML Comment Template for Register
2828
public void Register(IServiceConventionContext context)
2929
{
30+
var coreBuilder = context.Services
31+
.AddMvcCore()
32+
.AddControllersAsServices()
33+
.AddApiExplorer();
3034
foreach (var item in context.AssemblyCandidateFinder.GetCandidateAssemblies("Rocket.Surgery.AspNetCore", "Microsoft.AspNetCore.Mvc"))
3135
{
32-
context.Services.AddMvcCore()
36+
coreBuilder
3337
.AddApplicationPart(item);
3438
}
3539

0 commit comments

Comments
 (0)