From 003ad891d03e4c3c25642a1d46ab4a0d35361386 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 8 Oct 2015 17:13:52 -0700 Subject: [PATCH] Replacing NotNullAttribute with thrown exceptions --- .../OverrideHeaderMiddleware.cs | 13 +++++++++++-- src/Microsoft.AspNet.HttpOverrides/project.json | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.HttpOverrides/OverrideHeaderMiddleware.cs b/src/Microsoft.AspNet.HttpOverrides/OverrideHeaderMiddleware.cs index b036b9e..dd3cb92 100644 --- a/src/Microsoft.AspNet.HttpOverrides/OverrideHeaderMiddleware.cs +++ b/src/Microsoft.AspNet.HttpOverrides/OverrideHeaderMiddleware.cs @@ -6,7 +6,6 @@ using System.Net; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.HttpOverrides { @@ -21,8 +20,18 @@ namespace Microsoft.AspNet.HttpOverrides private readonly OverrideHeaderMiddlewareOptions _options; private readonly RequestDelegate _next; - public OverrideHeaderMiddleware([NotNull] RequestDelegate next, [NotNull] OverrideHeaderMiddlewareOptions options) + public OverrideHeaderMiddleware(RequestDelegate next, OverrideHeaderMiddlewareOptions options) { + if (next == null) + { + throw new ArgumentNullException(nameof(next)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + _options = options; _next = next; } diff --git a/src/Microsoft.AspNet.HttpOverrides/project.json b/src/Microsoft.AspNet.HttpOverrides/project.json index 46de367..d791008 100644 --- a/src/Microsoft.AspNet.HttpOverrides/project.json +++ b/src/Microsoft.AspNet.HttpOverrides/project.json @@ -6,8 +6,7 @@ "url": "git://github.com/aspnet/basicmiddleware" }, "dependencies": { - "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.Extensions.NotNullAttribute.Sources": { "version": "1.0.0-*", "type": "build" } + "Microsoft.AspNet.Http.Extensions": "1.0.0-*" }, "frameworks": { "dnx451": { },