Used nameof expression to resolve parameters name
This commit is contained in:
parent
c0255f4188
commit
4a9029fc9c
|
|
@ -82,8 +82,8 @@ namespace Microsoft.AspNet.Diagnostics.Entity
|
|||
|
||||
public virtual void SetError([NotNull] Type contextType, [NotNull] Exception exception)
|
||||
{
|
||||
Check.NotNull(contextType, "contextType");
|
||||
Check.NotNull(exception, "exception");
|
||||
Check.NotNull(contextType, nameof(contextType));
|
||||
Check.NotNull(exception, nameof(exception));
|
||||
|
||||
_contextType = contextType;
|
||||
_exception = exception;
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@ namespace Microsoft.AspNet.Builder
|
|||
{
|
||||
public static IApplicationBuilder UseDatabaseErrorPage([NotNull] this IApplicationBuilder builder)
|
||||
{
|
||||
Check.NotNull(builder, "builder");
|
||||
Check.NotNull(builder, nameof(builder));
|
||||
|
||||
return builder.UseDatabaseErrorPage(DatabaseErrorPageOptions.ShowAll);
|
||||
}
|
||||
|
||||
public static IApplicationBuilder UseDatabaseErrorPage([NotNull] this IApplicationBuilder builder, [NotNull] DatabaseErrorPageOptions options)
|
||||
{
|
||||
Check.NotNull(builder, "builder");
|
||||
Check.NotNull(options, "options");
|
||||
Check.NotNull(builder, nameof(builder));
|
||||
Check.NotNull(options, nameof(options));
|
||||
|
||||
return builder.UseMiddleware<DatabaseErrorPageMiddleware>(options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity
|
|||
|
||||
public DatabaseErrorPageMiddleware([NotNull] RequestDelegate next, [NotNull] IServiceProvider serviceProvider, [NotNull] ILoggerFactory loggerFactory, [NotNull] DatabaseErrorPageOptions options)
|
||||
{
|
||||
Check.NotNull(next, "next");
|
||||
Check.NotNull(serviceProvider, "serviceProvider");
|
||||
Check.NotNull(loggerFactory, "loggerFactory");
|
||||
Check.NotNull(options, "options");
|
||||
Check.NotNull(next, nameof(next));
|
||||
Check.NotNull(serviceProvider, nameof(serviceProvider));
|
||||
Check.NotNull(loggerFactory, nameof(loggerFactory));
|
||||
Check.NotNull(options, nameof(options));
|
||||
|
||||
_next = next;
|
||||
_serviceProvider = serviceProvider;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity
|
|||
public static DatabaseErrorPageOptions ShowAll => new DatabaseErrorPageOptions
|
||||
{
|
||||
ShowExceptionDetails = true,
|
||||
ListMigrations = true,
|
||||
ListMigrations = true
|
||||
};
|
||||
|
||||
public virtual bool ShowExceptionDetails { get; set; }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Utilities
|
|||
[ContractAnnotation("value:null => halt")]
|
||||
public static T NotNull<T>([NoEnumeration] T value, [InvokerParameterName] [NotNull] string parameterName)
|
||||
{
|
||||
NotEmpty(parameterName, "parameterName");
|
||||
NotEmpty(parameterName, nameof(parameterName));
|
||||
|
||||
if (ReferenceEquals(value, null))
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Utilities
|
|||
[ContractAnnotation("value:null => halt")]
|
||||
public static IReadOnlyList<T> NotEmpty<T>(IReadOnlyList<T> value, [InvokerParameterName] [NotNull] string parameterName)
|
||||
{
|
||||
NotEmpty(parameterName, "parameterName");
|
||||
NotEmpty(parameterName, nameof(parameterName));
|
||||
NotNull(value, parameterName);
|
||||
|
||||
if (value.Count == 0)
|
||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Utilities
|
|||
{
|
||||
if (ReferenceEquals(parameterName, null))
|
||||
{
|
||||
throw new ArgumentNullException("parameterName");
|
||||
throw new ArgumentNullException(nameof(parameterName));
|
||||
}
|
||||
|
||||
if (parameterName.Length == 0)
|
||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Utilities
|
|||
public static T IsDefined<T>(T value, [InvokerParameterName] [NotNull] string parameterName)
|
||||
where T : struct
|
||||
{
|
||||
NotEmpty(parameterName, "parameterName");
|
||||
NotEmpty(parameterName, nameof(parameterName));
|
||||
|
||||
if (!Enum.IsDefined(typeof(T), value))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue