Using [NotNull]
This commit is contained in:
parent
8508c6256e
commit
1f36174da5
|
|
@ -6,6 +6,7 @@
|
|||
using System;
|
||||
using Microsoft.AspNet.Abstractions;
|
||||
using Microsoft.AspNet.Diagnostics;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Builder
|
||||
{
|
||||
|
|
@ -20,13 +21,8 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <param name="builder"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static IApplicationBuilder UseDiagnosticsPage(this IApplicationBuilder builder, DiagnosticsPageOptions options)
|
||||
public static IApplicationBuilder UseDiagnosticsPage([NotNull] this IApplicationBuilder builder, DiagnosticsPageOptions options)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException("builder");
|
||||
}
|
||||
|
||||
return builder.Use(next => new DiagnosticsPageMiddleware(next, options).Invoke);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNet.Diagnostics;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Builder
|
||||
{
|
||||
|
|
@ -17,13 +18,8 @@ namespace Microsoft.AspNet.Builder
|
|||
/// </summary>
|
||||
/// <param name="builder"></param>
|
||||
/// <returns></returns>
|
||||
public static IApplicationBuilder UseErrorPage(this IApplicationBuilder builder)
|
||||
public static IApplicationBuilder UseErrorPage([NotNull] this IApplicationBuilder builder)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException("builder");
|
||||
}
|
||||
|
||||
return builder.UseErrorPage(new ErrorPageOptions());
|
||||
}
|
||||
|
||||
|
|
@ -34,12 +30,8 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <param name="builder"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static IApplicationBuilder UseErrorPage(this IApplicationBuilder builder, ErrorPageOptions options)
|
||||
public static IApplicationBuilder UseErrorPage([NotNull] this IApplicationBuilder builder, ErrorPageOptions options)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException("builder");
|
||||
}
|
||||
/* TODO: Development, Staging, or Production
|
||||
string appMode = new AppProperties(builder.Properties).Get<string>(Constants.HostAppMode);
|
||||
bool isDevMode = string.Equals(Constants.DevMode, appMode, StringComparison.Ordinal);*/
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ using Microsoft.AspNet.Builder;
|
|||
using Microsoft.AspNet.Diagnostics.Views;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.Framework.Runtime;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Diagnostics
|
||||
{
|
||||
|
|
@ -31,16 +32,8 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
/// <param name="next"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="isDevMode"></param>
|
||||
public ErrorPageMiddleware(RequestDelegate next, ErrorPageOptions options, bool isDevMode)
|
||||
public ErrorPageMiddleware([NotNull] RequestDelegate next, [NotNull] ErrorPageOptions options, bool isDevMode)
|
||||
{
|
||||
if (next == null)
|
||||
{
|
||||
throw new ArgumentNullException("next");
|
||||
}
|
||||
if (options == null)
|
||||
{
|
||||
throw new ArgumentNullException("options");
|
||||
}
|
||||
if (isDevMode)
|
||||
{
|
||||
options.SetDefaultVisibility(isVisible: true);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Diagnostics;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Builder
|
||||
{
|
||||
|
|
@ -19,13 +20,8 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <param name="builder"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static IApplicationBuilder UseWelcomePage(this IApplicationBuilder builder, WelcomePageOptions options)
|
||||
public static IApplicationBuilder UseWelcomePage([NotNull] this IApplicationBuilder builder, WelcomePageOptions options)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException("builder");
|
||||
}
|
||||
|
||||
return builder.Use(next => new WelcomePageMiddleware(next, options).Invoke);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.AspNet.Diagnostics.Views;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Diagnostics
|
||||
{
|
||||
|
|
@ -24,17 +25,8 @@ namespace Microsoft.AspNet.Diagnostics
|
|||
/// </summary>
|
||||
/// <param name="next"></param>
|
||||
/// <param name="options"></param>
|
||||
public WelcomePageMiddleware(RequestDelegate next, WelcomePageOptions options)
|
||||
public WelcomePageMiddleware([NotNull] RequestDelegate next, [NotNull] WelcomePageOptions options)
|
||||
{
|
||||
if (next == null)
|
||||
{
|
||||
throw new ArgumentNullException("next");
|
||||
}
|
||||
if (options == null)
|
||||
{
|
||||
throw new ArgumentNullException("options");
|
||||
}
|
||||
|
||||
_next = next;
|
||||
_options = options;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue