Skip to content

Commit 22db32e

Browse files
authored
Add generic constraint for AddHttpApplication (#567)
This adds a generic constraint for HttpApplication for one of the overloads of `AddHttpApplication`. The other overload has it, but this one does not. Things will fail at run time if someone is using it with a non-`HttpApplication` derived type, so this will move error to compile time.
1 parent 91322f1 commit 22db32e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Microsoft.AspNetCore.SystemWebAdapters.CoreServices/HttpApplication/HttpApplicationExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private static ISystemWebAdapterBuilder AddHttpApplicationInternal(this ISystemW
6161
}
6262

6363
public static ISystemWebAdapterBuilder AddHttpApplication<TApp>(this ISystemWebAdapterBuilder builder)
64+
where TApp : HttpApplication
6465
{
6566
ArgumentNullException.ThrowIfNull(builder);
6667

0 commit comments

Comments
 (0)