House Cleaning - Spelling and grammar 🚿
This commit is contained in:
parent
87027de89c
commit
16c267d95e
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Mvc.Performance
|
||||||
{
|
{
|
||||||
private const int Seed = 1000;
|
private const int Seed = 1000;
|
||||||
|
|
||||||
// About 35 or so plausable sounding conventional routing actions.
|
// About 35 or so plausible sounding conventional routing actions.
|
||||||
//
|
//
|
||||||
// We include some duplicates here, because that's what happens when you have one method that handles
|
// We include some duplicates here, because that's what happens when you have one method that handles
|
||||||
// GET and one that handles POST.
|
// GET and one that handles POST.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Mvc.ActionConstraints
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="ActionDescriptor"/> representing a candiate for selection.
|
/// The <see cref="ActionDescriptor"/> representing a candidate for selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ActionDescriptor Action { get; }
|
public ActionDescriptor Action { get; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
||||||
/// with a higher value of Scope execute later in the pipeline. See <c>Microsoft.AspNetCore.Mvc.FilterScope</c>
|
/// with a higher value of Scope execute later in the pipeline. See <c>Microsoft.AspNetCore.Mvc.FilterScope</c>
|
||||||
/// for commonly used scopes.
|
/// for commonly used scopes.
|
||||||
///
|
///
|
||||||
/// For <see cref="IExceptionFilter"/> implementions, the filter runs only after an exception has occurred,
|
/// For <see cref="IExceptionFilter"/> implementations, the filter runs only after an exception has occurred,
|
||||||
/// and so the observed order of execution will be opposite that of other filters.
|
/// and so the observed order of execution will be opposite that of other filters.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class FilterDescriptor
|
public class FilterDescriptor
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value which indicates whether or not execution was canceled by a resource filter.
|
/// Gets or sets a value which indicates whether or not execution was canceled by a resource filter.
|
||||||
/// If true, then a resource filter short-circuted execution by setting
|
/// If true, then a resource filter short-circuited execution by setting
|
||||||
/// <see cref="ResourceExecutingContext.Result"/>.
|
/// <see cref="ResourceExecutingContext.Result"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual bool Canceled { get; set; }
|
public virtual bool Canceled { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc.Abstractions;
|
||||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A <see cref="BindingSources"/> which can repesent multiple value-provider data sources.
|
/// A <see cref="BindingSources"/> which can represent multiple value-provider data sources.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CompositeBindingSource : BindingSource
|
public class CompositeBindingSource : BindingSource
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Metadata which specificies the data source for model binding.
|
/// Metadata which specifies the data source for model binding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBindingSourceMetadata
|
public interface IBindingSourceMetadata
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="Type"/> defining the model property respresented by the current
|
/// Gets the <see cref="Type"/> defining the model property represented by the current
|
||||||
/// instance, or <c>null</c> if the current instance does not represent a property.
|
/// instance, or <c>null</c> if the current instance does not represent a property.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Type ContainerType { get; private set; }
|
public Type ContainerType { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -419,7 +419,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
// Normaly caching the hashcode would be dangerous, but Identity is deeply immutable so this is safe.
|
// Normally caching the hashcode would be dangerous, but Identity is deeply immutable so this is safe.
|
||||||
if (_hashCode == null)
|
if (_hashCode == null)
|
||||||
{
|
{
|
||||||
_hashCode = Identity.GetHashCode();
|
_hashCode = Identity.GetHashCode();
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
||||||
// For any property which is a leaf node, we don't want to keep traversing:
|
// For any property which is a leaf node, we don't want to keep traversing:
|
||||||
//
|
//
|
||||||
// 1) Collections - while it's possible to have binder attributes on the inside of a collection,
|
// 1) Collections - while it's possible to have binder attributes on the inside of a collection,
|
||||||
// it hardly seems useful, and would result in some very wierd binding.
|
// it hardly seems useful, and would result in some very weird binding.
|
||||||
//
|
//
|
||||||
// 2) Simple Types - These are generally part of the .net framework - primitives, or types which have a
|
// 2) Simple Types - These are generally part of the .net framework - primitives, or types which have a
|
||||||
// type converter from string.
|
// type converter from string.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// provided.
|
/// provided.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="locationUri">The location at which the status of requested content can be monitored
|
/// <param name="locationUri">The location at which the status of requested content can be monitored
|
||||||
/// It is an optional paramater and may be null</param>
|
/// It is an optional parameter and may be null</param>
|
||||||
/// <param name="value">The value to format in the entity body.</param>
|
/// <param name="value">The value to format in the entity body.</param>
|
||||||
public AcceptedResult(Uri locationUri, object value)
|
public AcceptedResult(Uri locationUri, object value)
|
||||||
: base(value)
|
: base(value)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows customization of the of the <see cref="ControllerModel"/>.
|
/// Allows customization of the <see cref="ControllerModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// To use this interface, create an <see cref="System.Attribute"/> class which implements the interface and
|
/// To use this interface, create an <see cref="System.Attribute"/> class which implements the interface and
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creats a new instance of <see cref="PropertyModel"/> from a given <see cref="PropertyModel"/>.
|
/// Creates a new instance of <see cref="PropertyModel"/> from a given <see cref="PropertyModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="other">The <see cref="PropertyModel"/> which needs to be copied.</param>
|
/// <param name="other">The <see cref="PropertyModel"/> which needs to be copied.</param>
|
||||||
public PropertyModel(PropertyModel other)
|
public PropertyModel(PropertyModel other)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
|
||||||
ICompilationReferencesProvider
|
ICompilationReferencesProvider
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initalizes a new <see cref="AssemblyPart"/> instance.
|
/// Initializes a new <see cref="AssemblyPart"/> instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assembly"></param>
|
/// <param name="assembly"></param>
|
||||||
public AssemblyPart(Assembly assembly)
|
public AssemblyPart(Assembly assembly)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
private Func<ModelMetadata, bool> _propertyFilter;
|
private Func<ModelMetadata, bool> _propertyFilter;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new instace of <see cref="BindAttribute"/>.
|
/// Creates a new instance of <see cref="BindAttribute"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="include">Names of parameters to include in binding.</param>
|
/// <param name="include">Names of parameters to include in binding.</param>
|
||||||
public BindAttribute(params string[] include)
|
public BindAttribute(params string[] include)
|
||||||
|
|
|
||||||
|
|
@ -1842,7 +1842,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
=> new ChallengeResult(properties);
|
=> new ChallengeResult(properties);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ChallengeResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="ChallengeResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
|
|
@ -1903,7 +1903,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
||||||
/// specified specified authentication schemes and <paramref name="properties" />.
|
/// specified authentication schemes and <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
/// challenge.</param>
|
/// challenge.</param>
|
||||||
|
|
@ -1928,7 +1928,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
=> new SignInResult(authenticationScheme, principal);
|
=> new SignInResult(authenticationScheme, principal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignInResult"/> with the specified specified authentication scheme and
|
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
||||||
|
|
@ -1952,7 +1952,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
=> new SignOutResult(authenticationSchemes);
|
=> new SignOutResult(authenticationSchemes);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignOutResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="SignOutResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
public static AuthorizeFilter GetFilter(IAuthorizationPolicyProvider policyProvider, IEnumerable<IAuthorizeData> authData)
|
public static AuthorizeFilter GetFilter(IAuthorizationPolicyProvider policyProvider, IEnumerable<IAuthorizeData> authData)
|
||||||
{
|
{
|
||||||
// The default policy provider will make the same policy for given input, so make it only once.
|
// The default policy provider will make the same policy for given input, so make it only once.
|
||||||
// This will always execute syncronously.
|
// This will always execute synchronously.
|
||||||
if (policyProvider.GetType() == typeof(DefaultAuthorizationPolicyProvider))
|
if (policyProvider.GetType() == typeof(DefaultAuthorizationPolicyProvider))
|
||||||
{
|
{
|
||||||
var policy = AuthorizationPolicy.CombineAsync(policyProvider, authData).GetAwaiter().GetResult();
|
var policy = AuthorizationPolicy.CombineAsync(policyProvider, authData).GetAwaiter().GetResult();
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
throw new ArgumentNullException(nameof(typeInfo));
|
throw new ArgumentNullException(nameof(typeInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
// For attribute routes on a controller, we want want to support 'overriding' routes on a derived
|
// For attribute routes on a controller, we want to support 'overriding' routes on a derived
|
||||||
// class. So we need to walk up the hierarchy looking for the first class to define routes.
|
// class. So we need to walk up the hierarchy looking for the first class to define routes.
|
||||||
//
|
//
|
||||||
// Then we want to 'filter' the set of attributes, so that only the effective routes apply.
|
// Then we want to 'filter' the set of attributes, so that only the effective routes apply.
|
||||||
|
|
@ -291,7 +291,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
//TODO: modify comment
|
//TODO: modify comment
|
||||||
// Now we need to determine the action selection info (cross-section of routes and constraints)
|
// Now we need to determine the action selection info (cross-section of routes and constraints)
|
||||||
//
|
//
|
||||||
// For attribute routes on a action, we want want to support 'overriding' routes on a
|
// For attribute routes on a action, we want to support 'overriding' routes on a
|
||||||
// virtual method, but allow 'overriding'. So we need to walk up the hierarchy looking
|
// virtual method, but allow 'overriding'. So we need to walk up the hierarchy looking
|
||||||
// for the first definition to define routes.
|
// for the first definition to define routes.
|
||||||
//
|
//
|
||||||
|
|
@ -377,7 +377,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overriden methods from Object class, e.g. Equals(Object), GetHashCode(), etc., are not valid.
|
// Overridden methods from Object class, e.g. Equals(Object), GetHashCode(), etc., are not valid.
|
||||||
if (methodInfo.GetBaseDefinition().DeclaringType == typeof(object))
|
if (methodInfo.GetBaseDefinition().DeclaringType == typeof(object))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
var scope = EnterNestedScope();
|
var scope = EnterNestedScope();
|
||||||
|
|
||||||
// Only filter if the new BindingSource affects the value providers. Otherwise we want
|
// Only filter if the new BindingSource affects the value providers. Otherwise we want
|
||||||
// to preserve the currrent state.
|
// to preserve the current state.
|
||||||
if (modelMetadata.BindingSource != null && !modelMetadata.BindingSource.IsGreedy)
|
if (modelMetadata.BindingSource != null && !modelMetadata.BindingSource.IsGreedy)
|
||||||
{
|
{
|
||||||
ValueProvider = FilterValueProvider(OriginalValueProvider, modelMetadata.BindingSource);
|
ValueProvider = FilterValueProvider(OriginalValueProvider, modelMetadata.BindingSource);
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
namespace Microsoft.AspNetCore.Mvc.Internal
|
namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An implementation of <see cref="IValidationStrategy"/> for a collection bound using 'explict indexing'
|
/// An implementation of <see cref="IValidationStrategy"/> for a collection bound using 'explicit indexing'
|
||||||
/// style keys.
|
/// style keys.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This implemenation handles cases like:
|
/// This implementation handles cases like:
|
||||||
/// <example>
|
/// <example>
|
||||||
/// Model: IList<Student>
|
/// Model: IList<Student>
|
||||||
/// Query String: ?students.index=Joey,Katherine&students[Joey].Age=8&students[Katherine].Age=9
|
/// Query String: ?students.index=Joey,Katherine&students[Joey].Age=8&students[Katherine].Age=9
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Internal
|
||||||
return HttpParseResult.NotParsed;
|
return HttpParseResult.NotParsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quoted-char has 2 characters. Check wheter there are 2 chars left ('\' + char)
|
// Quoted-char has 2 characters. Check whether there are 2 chars left ('\' + char)
|
||||||
// If so, check whether the character is in the range 0-127. If not, it's an invalid value.
|
// If so, check whether the character is in the range 0-127. If not, it's an invalid value.
|
||||||
if ((startIndex + 2 > input.Length) || (input[startIndex + 1] > 127))
|
if ((startIndex + 2 > input.Length) || (input[startIndex + 1] > 127))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
// Capture the current context into the feature. This will later be used in the end middleware to continue
|
// Capture the current context into the feature. This will later be used in the end middleware to continue
|
||||||
// the execution flow to later MVC layers.
|
// the execution flow to later MVC layers.
|
||||||
// Example:
|
// Example:
|
||||||
// this filter -> user-middleware1 -> user-middleware2 -> the-end-middleware -> resouce filters or model binding
|
// this filter -> user-middleware1 -> user-middleware2 -> the-end-middleware -> resource filters or model binding
|
||||||
var feature = new MiddlewareFilterFeature()
|
var feature = new MiddlewareFilterFeature()
|
||||||
{
|
{
|
||||||
ResourceExecutionDelegate = next,
|
ResourceExecutionDelegate = next,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
// or model binding), add a middleware at the end of the user provided pipeline which make sure to continue
|
// or model binding), add a middleware at the end of the user provided pipeline which make sure to continue
|
||||||
// this flow.
|
// this flow.
|
||||||
// Example:
|
// Example:
|
||||||
// middleware filter -> user-middleware1 -> user-middleware2 -> end-middleware -> resouce filters or model binding
|
// middleware filter -> user-middleware1 -> user-middleware2 -> end-middleware -> resource filters or model binding
|
||||||
nestedAppBuilder.Run(async (httpContext) =>
|
nestedAppBuilder.Run(async (httpContext) =>
|
||||||
{
|
{
|
||||||
var feature = httpContext.Features.Get<IMiddlewareFilterFeature>();
|
var feature = httpContext.Features.Get<IMiddlewareFilterFeature>();
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
|
|
||||||
if (exceptionContext.Exception == null || exceptionContext.ExceptionHandled)
|
if (exceptionContext.Exception == null || exceptionContext.ExceptionHandled)
|
||||||
{
|
{
|
||||||
// We don't need to do anthing to trigger a short circuit. If there's another
|
// We don't need to do anything to trigger a short circuit. If there's another
|
||||||
// exception filter on the stack it will check the same set of conditions
|
// exception filter on the stack it will check the same set of conditions
|
||||||
// and then just skip itself.
|
// and then just skip itself.
|
||||||
_logger.ExceptionFilterShortCircuited(filter);
|
_logger.ExceptionFilterShortCircuited(filter);
|
||||||
|
|
@ -566,7 +566,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
|
|
||||||
if (exceptionContext.Exception == null || exceptionContext.ExceptionHandled)
|
if (exceptionContext.Exception == null || exceptionContext.ExceptionHandled)
|
||||||
{
|
{
|
||||||
// We don't need to do anthing to trigger a short circuit. If there's another
|
// We don't need to do anything to trigger a short circuit. If there's another
|
||||||
// exception filter on the stack it will check the same set of conditions
|
// exception filter on the stack it will check the same set of conditions
|
||||||
// and then just skip itself.
|
// and then just skip itself.
|
||||||
_logger.ExceptionFilterShortCircuited(filter);
|
_logger.ExceptionFilterShortCircuited(filter);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
/// <typeparam name="TKey">The <see cref="Type"/> of the keys of the model dictionary.</typeparam>
|
/// <typeparam name="TKey">The <see cref="Type"/> of the keys of the model dictionary.</typeparam>
|
||||||
/// <typeparam name="TValue">The <see cref="Type"/> of the values of the model dictionary.</typeparam>
|
/// <typeparam name="TValue">The <see cref="Type"/> of the values of the model dictionary.</typeparam>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This implemenation handles cases like:
|
/// This implementation handles cases like:
|
||||||
/// <example>
|
/// <example>
|
||||||
/// Model: IDictionary<string, Student>
|
/// Model: IDictionary<string, Student>
|
||||||
/// Query String: ?students[Joey].Age=8&students[Katherine].Age=9
|
/// Query String: ?students[Joey].Age=8&students[Katherine].Age=9
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="localUrl">The local URL to redirect to.</param>
|
/// <param name="localUrl">The local URL to redirect to.</param>
|
||||||
/// <param name="permanent">Specifies whether the redirect should be permanent (301) or temporary (302).</param>
|
/// <param name="permanent">Specifies whether the redirect should be permanent (301) or temporary (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request's method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request's method.</param>
|
||||||
public LocalRedirectResult(string localUrl, bool permanent, bool preserveMethod)
|
public LocalRedirectResult(string localUrl, bool permanent, bool preserveMethod)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(localUrl))
|
if (string.IsNullOrEmpty(localUrl))
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
||||||
public string DisplayFormatString { get; set; }
|
public string DisplayFormatString { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a delegate delegate which is used to get a value for the
|
/// Gets or sets a delegate which is used to get a value for the
|
||||||
/// display name of the model. See <see cref="ModelMetadata.DisplayName"/>.
|
/// display name of the model. See <see cref="ModelMetadata.DisplayName"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Func<string> DisplayName { get; set; }
|
public Func<string> DisplayName { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
return NoOpBinder.Instance;
|
return NoOpBinder.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A non-null token will usually be passed in at the the top level (ParameterDescriptor likely).
|
// A non-null token will usually be passed in at the top level (ParameterDescriptor likely).
|
||||||
// This prevents us from treating a parameter the same as a collection-element - which could
|
// This prevents us from treating a parameter the same as a collection-element - which could
|
||||||
// happen looking at just model metadata.
|
// happen looking at just model metadata.
|
||||||
var key = new Key(providerContext.Metadata, token);
|
var key = new Key(providerContext.Metadata, token);
|
||||||
|
|
@ -253,7 +253,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
// For non-root nodes we use the ModelMetadata as the cache token. This ensures that all non-root
|
// For non-root nodes we use the ModelMetadata as the cache token. This ensures that all non-root
|
||||||
// nodes with the same metadata will have the the same binder. This is OK because for an non-root
|
// nodes with the same metadata will have the same binder. This is OK because for an non-root
|
||||||
// node there's no opportunity to customize binding info like there is for a parameter.
|
// node there's no opportunity to customize binding info like there is for a parameter.
|
||||||
var token = metadata;
|
var token = metadata;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="url">The URL to redirect to.</param>
|
/// <param name="url">The URL to redirect to.</param>
|
||||||
/// <param name="permanent">Specifies whether the redirect should be permanent (301) or temporary (302).</param>
|
/// <param name="permanent">Specifies whether the redirect should be permanent (301) or temporary (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
public RedirectResult(string url, bool permanent, bool preserveMethod)
|
public RedirectResult(string url, bool permanent, bool preserveMethod)
|
||||||
{
|
{
|
||||||
if (url == null)
|
if (url == null)
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="controllerName">The name of the controller to use for generating the URL.</param>
|
/// <param name="controllerName">The name of the controller to use for generating the URL.</param>
|
||||||
/// <param name="routeValues">The route data to use for generating the URL.</param>
|
/// <param name="routeValues">The route data to use for generating the URL.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
public RedirectToActionResult(
|
public RedirectToActionResult(
|
||||||
string actionName,
|
string actionName,
|
||||||
string controllerName,
|
string controllerName,
|
||||||
|
|
@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="controllerName">The name of the controller to use for generating the URL.</param>
|
/// <param name="controllerName">The name of the controller to use for generating the URL.</param>
|
||||||
/// <param name="routeValues">The route data to use for generating the URL.</param>
|
/// <param name="routeValues">The route data to use for generating the URL.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) and permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) and permanent redirect (308) preserve the initial request method.</param>
|
||||||
/// <param name="fragment">The fragment to add to the URL.</param>
|
/// <param name="fragment">The fragment to add to the URL.</param>
|
||||||
public RedirectToActionResult(
|
public RedirectToActionResult(
|
||||||
string actionName,
|
string actionName,
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="pageHandler">The page handler to redirect to.</param>
|
/// <param name="pageHandler">The page handler to redirect to.</param>
|
||||||
/// <param name="routeValues">The parameters for the page.</param>
|
/// <param name="routeValues">The parameters for the page.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
public RedirectToPageResult(
|
public RedirectToPageResult(
|
||||||
string pageName,
|
string pageName,
|
||||||
string pageHandler,
|
string pageHandler,
|
||||||
|
|
@ -140,7 +140,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="pageHandler">The page handler to redirect to.</param>
|
/// <param name="pageHandler">The page handler to redirect to.</param>
|
||||||
/// <param name="routeValues">The parameters for the page.</param>
|
/// <param name="routeValues">The parameters for the page.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
/// <param name="fragment">The fragment to add to the URL.</param>
|
/// <param name="fragment">The fragment to add to the URL.</param>
|
||||||
public RedirectToPageResult(
|
public RedirectToPageResult(
|
||||||
string pageName,
|
string pageName,
|
||||||
|
|
@ -169,7 +169,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
public string PageName { get; set; }
|
public string PageName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the the page handler to redirect to.
|
/// Gets or sets the page handler to redirect to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PageHandler { get; set; }
|
public string PageHandler { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="routeName">The name of the route.</param>
|
/// <param name="routeName">The name of the route.</param>
|
||||||
/// <param name="routeValues">The parameters for the route.</param>
|
/// <param name="routeValues">The parameters for the route.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
public RedirectToRouteResult(
|
public RedirectToRouteResult(
|
||||||
string routeName,
|
string routeName,
|
||||||
object routeValues,
|
object routeValues,
|
||||||
|
|
@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <param name="routeName">The name of the route.</param>
|
/// <param name="routeName">The name of the route.</param>
|
||||||
/// <param name="routeValues">The parameters for the route.</param>
|
/// <param name="routeValues">The parameters for the route.</param>
|
||||||
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
/// <param name="permanent">If set to true, makes the redirect permanent (301). Otherwise a temporary redirect is used (302).</param>
|
||||||
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the intial request method.</param>
|
/// <param name="preserveMethod">If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.</param>
|
||||||
/// <param name="fragment">The fragment to add to the URL.</param>
|
/// <param name="fragment">The fragment to add to the URL.</param>
|
||||||
public RedirectToRouteResult(
|
public RedirectToRouteResult(
|
||||||
string routeName,
|
string routeName,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
|
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface so that adapters provide their relevent values to error messages.
|
/// Interface so that adapters provide their relevant values to error messages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAttributeAdapter : IClientModelValidator
|
public interface IAttributeAdapter : IClientModelValidator
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisplayName
|
// DisplayName
|
||||||
// DisplayAttribute has precendence over DisplayNameAttribute.
|
// DisplayAttribute has precedence over DisplayNameAttribute.
|
||||||
if (displayAttribute?.GetName() != null)
|
if (displayAttribute?.GetName() != null)
|
||||||
{
|
{
|
||||||
if (localizer != null &&
|
if (localizer != null &&
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The declared type which could be wrapped/un-wrapped by a different type
|
/// The declared type which could be wrapped/un-wrapped by a different type
|
||||||
/// during serialization or de-serializatoin.
|
/// during serialization or deserialization.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Type DeclaredType { get; }
|
public Type DeclaredType { get; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using Microsoft.Extensions.Localization;
|
||||||
namespace Microsoft.AspNetCore.Mvc.Localization
|
namespace Microsoft.AspNetCore.Mvc.Localization
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type that that does HTML-aware localization of strings, by HTML encoding arguments that are
|
/// Represents a type that does HTML-aware localization of strings, by HTML encoding arguments that are
|
||||||
/// formatted in the resource string.
|
/// formatted in the resource string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHtmlLocalizer
|
public interface IHtmlLocalizer
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Compilation
|
||||||
public string RelativePath { get; set; }
|
public string RelativePath { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="RazorViewAttribute"/> decorating the sview.
|
/// Gets or sets the <see cref="RazorViewAttribute"/> decorating the view.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RazorViewAttribute ViewAttribute { get; set; }
|
public RazorViewAttribute ViewAttribute { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
||||||
public interface IRazorPage
|
public interface IRazorPage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the view context of the renderign view.
|
/// Gets or sets the view context of the rendering view.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ViewContext ViewContext { get; set; }
|
ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows customization of the of the <see cref="PageApplicationModel"/>.
|
/// Allows customization of the <see cref="PageApplicationModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPageApplicationModelConvention : IPageConvention
|
public interface IPageApplicationModelConvention : IPageConvention
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creats a new instance of <see cref="PageHandlerModel"/> from a given <see cref="PageHandlerModel"/>.
|
/// Creates a new instance of <see cref="PageHandlerModel"/> from a given <see cref="PageHandlerModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="other">The <see cref="PageHandlerModel"/> which needs to be copied.</param>
|
/// <param name="other">The <see cref="PageHandlerModel"/> which needs to be copied.</param>
|
||||||
public PageHandlerModel(PageHandlerModel other)
|
public PageHandlerModel(PageHandlerModel other)
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creats a new instance of <see cref="PagePropertyModel"/> from a given <see cref="PagePropertyModel"/>.
|
/// Creates a new instance of <see cref="PagePropertyModel"/> from a given <see cref="PagePropertyModel"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="other">The <see cref="PagePropertyModel"/> which needs to be copied.</param>
|
/// <param name="other">The <see cref="PagePropertyModel"/> which needs to be copied.</param>
|
||||||
public PagePropertyModel(PagePropertyModel other)
|
public PagePropertyModel(PagePropertyModel other)
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overriden methods from Object class, e.g. Equals(Object), GetHashCode(), etc., are not valid.
|
// Overridden methods from Object class, e.g. Equals(Object), GetHashCode(), etc., are not valid.
|
||||||
if (methodInfo.GetBaseDefinition().DeclaringType == typeof(object))
|
if (methodInfo.GetBaseDefinition().DeclaringType == typeof(object))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new ChallengeResult(properties);
|
=> new ChallengeResult(properties);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ChallengeResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="ChallengeResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
|
|
@ -296,7 +296,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
||||||
/// specified specified authentication schemes and <paramref name="properties" />.
|
/// specified authentication schemes and <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
/// challenge.</param>
|
/// challenge.</param>
|
||||||
|
|
@ -1129,7 +1129,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new SignInResult(authenticationScheme, principal);
|
=> new SignInResult(authenticationScheme, principal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignInResult"/> with the specified specified authentication scheme and
|
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
||||||
|
|
@ -1151,7 +1151,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new SignOutResult(authenticationSchemes);
|
=> new SignOutResult(authenticationSchemes);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignOutResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="SignOutResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
||||||
|
|
|
||||||
|
|
@ -538,7 +538,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new ChallengeResult(properties);
|
=> new ChallengeResult(properties);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ChallengeResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="ChallengeResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
|
|
@ -649,7 +649,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
|
||||||
/// specified specified authentication schemes and <paramref name="properties" />.
|
/// specified authentication schemes and <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
|
||||||
/// challenge.</param>
|
/// challenge.</param>
|
||||||
|
|
@ -1502,7 +1502,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new SignInResult(authenticationScheme, principal);
|
=> new SignInResult(authenticationScheme, principal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignInResult"/> with the specified specified authentication scheme and
|
/// Creates a <see cref="SignInResult"/> with the specified authentication scheme and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param>
|
||||||
|
|
@ -1524,7 +1524,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
=> new SignOutResult(authenticationSchemes);
|
=> new SignOutResult(authenticationSchemes);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SignOutResult"/> with the specified specified authentication schemes and
|
/// Creates a <see cref="SignOutResult"/> with the specified authentication schemes and
|
||||||
/// <paramref name="properties" />.
|
/// <paramref name="properties" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the sign-out operation.</param>
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Mvc.Testing
|
||||||
"'<PreserveCompilationContext>true</PreserveCompilationContext>'." +
|
"'<PreserveCompilationContext>true</PreserveCompilationContext>'." +
|
||||||
$"For functional tests to work they need to either run from the build output folder or the {Path.GetFileName(depsFile.FullName)} " +
|
$"For functional tests to work they need to either run from the build output folder or the {Path.GetFileName(depsFile.FullName)} " +
|
||||||
$"file from your application's output directory must be copied" +
|
$"file from your application's output directory must be copied" +
|
||||||
"to the folder where the tests are running on. A common cause for this error is having shadow copying enabled when the" +
|
"to the folder where the tests are running on. A common cause for this error is having shadow copying enabled when the " +
|
||||||
"tests run.");
|
"tests run.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Mvc.Testing
|
||||||
/// The startup code defined in <typeparamref name = "TStartup" /> will be executed to configure the application.
|
/// The startup code defined in <typeparamref name = "TStartup" /> will be executed to configure the application.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// This constructor will infer the application root directive by searching for a solution file tht matches the pattern
|
/// This constructor will infer the application root directive by searching for a solution file that matches the pattern
|
||||||
/// <paramref name="solutionSearchPattern"/> and then appending the path <paramref name="solutionRelativePath"/>
|
/// <paramref name="solutionSearchPattern"/> and then appending the path <paramref name="solutionRelativePath"/>
|
||||||
/// to the solution directory.The application root directory will be used to discover views and content files.
|
/// to the solution directory.The application root directory will be used to discover views and content files.
|
||||||
/// </para>
|
/// </para>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
The functional tests act as the host application for all test websites. Since the CLI copies all reference
|
The functional tests act as the host application for all test websites. Since the CLI copies all reference
|
||||||
assembly dependencies in websites to their corresponding bin/{config}/refs folder we need to re-calculate
|
assembly dependencies in websites to their corresponding bin/{config}/refs folder we need to re-calculate
|
||||||
reference assemblies for this project so there's a corresponding refs folder in our output. Without it
|
reference assemblies for this project so there's a corresponding refs folder in our output. Without it
|
||||||
our websites deps files will fail to find their assembly referenes.
|
our websites deps files will fail to find their assembly references.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Properties decorated with <see cref="TempDataAttribute"/> will have their values stored in
|
/// Properties decorated with <see cref="TempDataAttribute"/> will have their values stored in
|
||||||
/// and loaded from the <see cref="ViewFeatures.TempDataDictionary"/>. <see cref="TempDataAttribute"/>
|
/// and loaded from the <see cref="ViewFeatures.TempDataDictionary"/>. <see cref="TempDataAttribute"/>
|
||||||
/// is supported on properties of Controllers, Razor Pages, and Razor Page Page Models.
|
/// is supported on properties of Controllers, Razor Pages, and Razor Page Models.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
|
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
|
||||||
public sealed class TempDataAttribute : Attribute
|
public sealed class TempDataAttribute : Attribute
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewComponents
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// The full name is defaulted to the full namespace of the view component class, prepended to
|
/// The full name is defaulted to the full namespace of the view component class, prepended to
|
||||||
/// the the class name with a '.' character as the separator. If the view component class uses
|
/// the class name with a '.' character as the separator. If the view component class uses
|
||||||
/// <code>ViewComponent</code> as a suffix, the suffix will be omitted from the <see cref="FullName"/>.
|
/// <code>ViewComponent</code> as a suffix, the suffix will be omitted from the <see cref="FullName"/>.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// <example>
|
/// <example>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
/// <param name="controllerName">The name of the controller.</param>
|
/// <param name="controllerName">The name of the controller.</param>
|
||||||
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
||||||
/// <param name="hostname">The hostname for the generated link.</param>
|
/// <param name="hostname">The hostname for the generated link.</param>
|
||||||
/// <param name="fragment">The fragment for the genrated link.</param>
|
/// <param name="fragment">The fragment for the generated link.</param>
|
||||||
/// <param name="routeValues">
|
/// <param name="routeValues">
|
||||||
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
||||||
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
||||||
|
|
@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
/// <param name="pageHandler">The page handler.</param>
|
/// <param name="pageHandler">The page handler.</param>
|
||||||
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
||||||
/// <param name="hostname">The hostname for the generated link.</param>
|
/// <param name="hostname">The hostname for the generated link.</param>
|
||||||
/// <param name="fragment">The fragment for the genrated link.</param>
|
/// <param name="fragment">The fragment for the generated link.</param>
|
||||||
/// <param name="routeValues">
|
/// <param name="routeValues">
|
||||||
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
||||||
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
||||||
|
|
@ -254,7 +254,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
/// <param name="routeName">The name of the route to use for link generation.</param>
|
/// <param name="routeName">The name of the route to use for link generation.</param>
|
||||||
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
/// <param name="protocol">The protocol (scheme) for the generated link.</param>
|
||||||
/// <param name="hostName">The hostname for the generated link.</param>
|
/// <param name="hostName">The hostname for the generated link.</param>
|
||||||
/// <param name="fragment">The fragment for the genrated link.</param>
|
/// <param name="fragment">The fragment for the generated link.</param>
|
||||||
/// <param name="routeValues">
|
/// <param name="routeValues">
|
||||||
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
/// An <see cref="object"/> that contains the parameters for a route. The parameters are retrieved through
|
||||||
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
/// reflection by examining the properties of the <see cref="object"/>. This <see cref="object"/> is typically
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
public SaveTempDataAttribute()
|
public SaveTempDataAttribute()
|
||||||
{
|
{
|
||||||
// Since SaveTempDataFilter registers for a response's OnStarting callback, we want this filter to run
|
// Since SaveTempDataFilter registers for a response's OnStarting callback, we want this filter to run
|
||||||
// as early as possible to get the oppurtunity to register the call back before any other result filter
|
// as early as possible to get the opportunity to register the call back before any other result filter
|
||||||
// starts writing to the response stream.
|
// starts writing to the response stream.
|
||||||
Order = int.MinValue + 100;
|
Order = int.MinValue + 100;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
/// passing parameter <paramref name="container"/> to lazily evaluate the value.
|
/// passing parameter <paramref name="container"/> to lazily evaluate the value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="container">The <see cref="object"/> that <see cref="Value"/> will be evaluated from.</param>
|
/// <param name="container">The <see cref="object"/> that <see cref="Value"/> will be evaluated from.</param>
|
||||||
/// <param name="propertyInfo">The <see cref="PropertyInfo"/> that will be used to evalute <see cref="Value"/>.</param>
|
/// <param name="propertyInfo">The <see cref="PropertyInfo"/> that will be used to evaluate <see cref="Value"/>.</param>
|
||||||
public ViewDataInfo(object container, PropertyInfo propertyInfo)
|
public ViewDataInfo(object container, PropertyInfo propertyInfo)
|
||||||
: this(container, propertyInfo, _propertyInfoResolver)
|
: this(container, propertyInfo, _propertyInfoResolver)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
private static IServiceCollection CreateServices(params ViewComponentDescriptor[] descriptors)
|
private static IServiceCollection CreateServices(params ViewComponentDescriptor[] descriptors)
|
||||||
{
|
{
|
||||||
// An array pool could return a buffer which is greater or equal to the size of the default character
|
// An array pool could return a buffer which is greater or equal to the size of the default character
|
||||||
// chunk size. Since the tests here depend on a specifc character buffer size to test boundary conditions,
|
// chunk size. Since the tests here depend on a specific character buffer size to test boundary conditions,
|
||||||
// make sure to only return a buffer of that size.
|
// make sure to only return a buffer of that size.
|
||||||
var charArrayPool = new Mock<ArrayPool<char>>();
|
var charArrayPool = new Mock<ArrayPool<char>>();
|
||||||
charArrayPool
|
charArrayPool
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
// This test verifies DefaultAssemblyPartDiscoveryProvider.ReferenceAssemblies reflects the actual loadable assemblies
|
// This test verifies DefaultAssemblyPartDiscoveryProvider.ReferenceAssemblies reflects the actual loadable assemblies
|
||||||
// of the libraries that Microsoft.AspNetCore.Mvc dependes on.
|
// of the libraries that Microsoft.AspNetCore.Mvc depends on.
|
||||||
// If we add or remove dependencies, this test should be changed together.
|
// If we add or remove dependencies, this test should be changed together.
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ReferenceAssemblies_ReturnsLoadableReferenceAssemblies()
|
public void ReferenceAssemblies_ReturnsLoadableReferenceAssemblies()
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
"text/bar; p1=p1-value; charset=us-ascii"
|
"text/bar; p1=p1-value; charset=us-ascii"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Content type set on action result takes precedence over the conten type set on http response
|
// Content type set on action result takes precedence over the content type set on http response
|
||||||
{
|
{
|
||||||
MediaTypeHeaderValue.Parse("text/foo; charset=us-ascii"),
|
MediaTypeHeaderValue.Parse("text/foo; charset=us-ascii"),
|
||||||
"text/bar",
|
"text/bar",
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Internal
|
||||||
PreLoad(preloadCount, validationStack);
|
PreLoad(preloadCount, validationStack);
|
||||||
|
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
// Poping null when it's not there must not throw
|
// Popping null when it's not there must not throw
|
||||||
validationStack.Pop(null);
|
validationStack.Pop(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -530,8 +530,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||||
Assert.Equal(1, widgetIdProvider.SuccessCount);
|
Assert.Equal(1, widgetIdProvider.SuccessCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a really wierd case, but I wanted to make sure it's covered so it doesn't
|
// This is a really weird case, but I wanted to make sure it's covered so it doesn't
|
||||||
// blow up in wierd ways.
|
// blow up in weird ways.
|
||||||
//
|
//
|
||||||
// If a binder provider tries to recursively create itself, but then returns null, we've
|
// If a binder provider tries to recursively create itself, but then returns null, we've
|
||||||
// already returned and possibly cached the PlaceholderBinder instance, we want to make sure that
|
// already returned and possibly cached the PlaceholderBinder instance, we want to make sure that
|
||||||
|
|
|
||||||
|
|
@ -791,7 +791,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Action_RouteValueInvalidation_AffectsOtherRouteValues()
|
public void Action_RouteValueInvalidation_AffectsOtherRouteValues()
|
||||||
{
|
{
|
||||||
// Arrage
|
// Arrange
|
||||||
var services = CreateServices();
|
var services = CreateServices();
|
||||||
var routeBuilder = CreateRouteBuilder(services);
|
var routeBuilder = CreateRouteBuilder(services);
|
||||||
|
|
||||||
|
|
@ -835,7 +835,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Action_RouteValueInvalidation_DoesNotAffectActionAndController_ActionPassedInRouteValues()
|
public void Action_RouteValueInvalidation_DoesNotAffectActionAndController_ActionPassedInRouteValues()
|
||||||
{
|
{
|
||||||
// Arrage
|
// Arrange
|
||||||
var services = CreateServices();
|
var services = CreateServices();
|
||||||
var routeBuilder = CreateRouteBuilder(services);
|
var routeBuilder = CreateRouteBuilder(services);
|
||||||
|
|
||||||
|
|
@ -898,7 +898,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
string virtualPath,
|
string virtualPath,
|
||||||
string expected)
|
string expected)
|
||||||
{
|
{
|
||||||
// Arrage
|
// Arrange
|
||||||
var router = Mock.Of<IRouter>();
|
var router = Mock.Of<IRouter>();
|
||||||
var pathData = new VirtualPathData(router, virtualPath)
|
var pathData = new VirtualPathData(router, virtualPath)
|
||||||
{
|
{
|
||||||
|
|
@ -921,7 +921,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
string virtualPath,
|
string virtualPath,
|
||||||
string expected)
|
string expected)
|
||||||
{
|
{
|
||||||
// Arrage
|
// Arrange
|
||||||
var fragmentValue = "fragment-value";
|
var fragmentValue = "fragment-value";
|
||||||
expected += $"#{fragmentValue}";
|
expected += $"#{fragmentValue}";
|
||||||
var router = Mock.Of<IRouter>();
|
var router = Mock.Of<IRouter>();
|
||||||
|
|
@ -954,7 +954,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
string fragment,
|
string fragment,
|
||||||
string expected)
|
string expected)
|
||||||
{
|
{
|
||||||
// Arrage
|
// Arrange
|
||||||
var router = Mock.Of<IRouter>();
|
var router = Mock.Of<IRouter>();
|
||||||
var pathData = new VirtualPathData(router, virtualPath)
|
var pathData = new VirtualPathData(router, virtualPath)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ END:VCARD
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ProducesAttribute_OnDerivedAction_OverridesTheValueOnBaseAction()
|
public async Task ProducesAttribute_OnDerivedAction_OverridesTheValueOnBaseAction()
|
||||||
{
|
{
|
||||||
// Arange
|
// Arrange
|
||||||
var expectedContentType = MediaTypeHeaderValue.Parse(
|
var expectedContentType = MediaTypeHeaderValue.Parse(
|
||||||
"application/custom_NoProducesContentOnClassController_Action;charset=utf-8");
|
"application/custom_NoProducesContentOnClassController_Action;charset=utf-8");
|
||||||
var expectedBody = "NoProducesContentOnClassController";
|
var expectedBody = "NoProducesContentOnClassController";
|
||||||
|
|
|
||||||
|
|
@ -523,7 +523,7 @@ Products: Music Systems, Televisions (3)";
|
||||||
Assert.Equal(expected, response, ignoreLineEndingDifferences: true);
|
Assert.Equal(expected, response, ignoreLineEndingDifferences: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to make sure that for 'wierd' model expressions involving:
|
// We want to make sure that for 'weird' model expressions involving:
|
||||||
// - fields
|
// - fields
|
||||||
// - statics
|
// - statics
|
||||||
// - private
|
// - private
|
||||||
|
|
@ -531,7 +531,7 @@ Products: Music Systems, Televisions (3)";
|
||||||
// These tests verify that we don't throw, and can evaluate the expression to get the model
|
// These tests verify that we don't throw, and can evaluate the expression to get the model
|
||||||
// value. One quirk of behavior for these cases is that we can't return a correct model metadata
|
// value. One quirk of behavior for these cases is that we can't return a correct model metadata
|
||||||
// instance (this is true for anything other than a public instance property). We're not overly
|
// instance (this is true for anything other than a public instance property). We're not overly
|
||||||
// concerned with that, and so the accuracy of the model metadata is is not verified by the test.
|
// concerned with that, and so the accuracy of the model metadata is not verified by the test.
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("GetWeirdWithHtmlHelpers")]
|
[InlineData("GetWeirdWithHtmlHelpers")]
|
||||||
[InlineData("GetWeirdWithTagHelpers")]
|
[InlineData("GetWeirdWithTagHelpers")]
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
Assert.Equal("User has been registerd : " + sampleName,
|
Assert.Equal("User has been registered : " + sampleName,
|
||||||
await response.Content.ReadAsStringAsync());
|
await response.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -597,7 +597,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
||||||
}
|
}
|
||||||
|
|
||||||
// By default the ComplexTypeModelBinder fails to construct models for types with no parameterless constructor,
|
// By default the ComplexTypeModelBinder fails to construct models for types with no parameterless constructor,
|
||||||
// but a developer could change this behavior by overridng CreateModel
|
// but a developer could change this behavior by overriding CreateModel
|
||||||
private class CustomComplexTypeModelBinder : ComplexTypeModelBinder
|
private class CustomComplexTypeModelBinder : ComplexTypeModelBinder
|
||||||
{
|
{
|
||||||
public CustomComplexTypeModelBinder(IDictionary<ModelMetadata, IModelBinder> propertyBinders)
|
public CustomComplexTypeModelBinder(IDictionary<ModelMetadata, IModelBinder> propertyBinders)
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to test the the 'empty' page has no bound properties, and no handler methods.
|
// We want to test the 'empty' page has no bound properties, and no handler methods.
|
||||||
[Fact]
|
[Fact]
|
||||||
public void OnProvidersExecuting_EmptyPage()
|
public void OnProvidersExecuting_EmptyPage()
|
||||||
{
|
{
|
||||||
|
|
@ -353,7 +353,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
Assert.Same(typeof(EmptyPage).GetTypeInfo(), pageModel.PageType);
|
Assert.Same(typeof(EmptyPage).GetTypeInfo(), pageModel.PageType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to test the the 'empty' page and pagemodel has no bound properties, and no handler methods.
|
// We want to test the 'empty' page and pagemodel has no bound properties, and no handler methods.
|
||||||
[Fact]
|
[Fact]
|
||||||
public void OnProvidersExecuting_EmptyPageModel()
|
public void OnProvidersExecuting_EmptyPageModel()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
var services = new ServiceCollection();
|
var services = new ServiceCollection();
|
||||||
services.AddSingleton<IHostingEnvironment>(GetHostingEnvironment());
|
services.AddSingleton<IHostingEnvironment>(GetHostingEnvironment());
|
||||||
|
|
||||||
// Register a mock implementation of each service, AddMvcServices should add another implemenetation.
|
// Register a mock implementation of each service, AddMvcServices should add another implementation.
|
||||||
foreach (var serviceType in MutliRegistrationServiceTypes)
|
foreach (var serviceType in MutliRegistrationServiceTypes)
|
||||||
{
|
{
|
||||||
var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key);
|
var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Mvc
|
namespace Microsoft.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
// Tests Controler for the unit testability with which users can simply instantiate contollers for unit tests
|
// Tests Controller for the unit testability with which users can simply instantiate controllers for unit tests
|
||||||
public class ControllerUnitTestabilityTests
|
public class ControllerUnitTestabilityTests
|
||||||
{
|
{
|
||||||
[Theory]
|
[Theory]
|
||||||
|
|
|
||||||
|
|
@ -129,12 +129,12 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
||||||
},
|
},
|
||||||
// Constants are not supported.
|
// Constants are not supported.
|
||||||
{
|
{
|
||||||
// Namespace never appears in expresison name. "Model" there doesn't matter.
|
// Namespace never appears in expression name. "Model" there doesn't matter.
|
||||||
(Expression<Func<TestModel, int>>)(m => Microsoft.AspNetCore.Mvc.ViewFeatures.Model.Constants.WoodstockYear),
|
(Expression<Func<TestModel, int>>)(m => Microsoft.AspNetCore.Mvc.ViewFeatures.Model.Constants.WoodstockYear),
|
||||||
string.Empty
|
string.Empty
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Class name never appears in expresion name. "Model" there doesn't matter.
|
// Class name never appears in expression name. "Model" there doesn't matter.
|
||||||
(Expression<Func<TestModel, int>>)(m => Model.Constants.WoodstockYear),
|
(Expression<Func<TestModel, int>>)(m => Model.Constants.WoodstockYear),
|
||||||
string.Empty
|
string.Empty
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -589,7 +589,7 @@ namespace Microsoft.AspNetCore.Mvc.Rendering
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
using (var form = htmlHelper.BeginForm(FormMethod.Post, antiforgery: false, htmlAttributes: null))
|
using (var form = htmlHelper.BeginForm(FormMethod.Post, antiforgery: false, htmlAttributes: null))
|
||||||
{
|
{
|
||||||
// This call will ouput a token.
|
// This call will output a token.
|
||||||
Assert.Equal("antiforgery", Assert.IsType<TagBuilder>(htmlHelper.AntiForgeryToken()).TagName);
|
Assert.Equal("antiforgery", Assert.IsType<TagBuilder>(htmlHelper.AntiForgeryToken()).TagName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ namespace Microsoft.TestCommon
|
||||||
/// <param name="variation">The test data variation with which to create the related <see cref="Type"/>.</param>
|
/// <param name="variation">The test data variation with which to create the related <see cref="Type"/>.</param>
|
||||||
/// <returns>The related <see cref="Type"/> for the <see cref="TestData.Type"/> as given by the test data variation.</returns>
|
/// <returns>The related <see cref="Type"/> for the <see cref="TestData.Type"/> as given by the test data variation.</returns>
|
||||||
/// <example>
|
/// <example>
|
||||||
/// For example, if the given <see cref="TestData"/> was created for <see cref="string"/> test data and the varation parameter
|
/// For example, if the given <see cref="TestData"/> was created for <see cref="string"/> test data and the variation parameter
|
||||||
/// was <see cref="TestDataVariations.AsList"/> then the returned type would be <see cref="List<string>"/>.
|
/// was <see cref="TestDataVariations.AsList"/> then the returned type would be <see cref="List<string>"/>.
|
||||||
/// </example>
|
/// </example>
|
||||||
public Type GetAsTypeOrNull(TestDataVariations variation)
|
public Type GetAsTypeOrNull(TestDataVariations variation)
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,6 @@ module.exports = function (grunt) {
|
||||||
grunt.registerTask("default", ["bower:install"]);
|
grunt.registerTask("default", ["bower:install"]);
|
||||||
|
|
||||||
// The following line loads the grunt plugins.
|
// The following line loads the grunt plugins.
|
||||||
// This line needs to be at the end of this this file.
|
// This line needs to be at the end of this file.
|
||||||
grunt.loadNpmTasks("grunt-bower-task");
|
grunt.loadNpmTasks("grunt-bower-task");
|
||||||
};
|
};
|
||||||
|
|
@ -19,7 +19,7 @@ namespace FormatterWebSite
|
||||||
ModelState["Designation"].Errors[0].ErrorMessage);
|
ModelState["Designation"].Errors[0].ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Content("User has been registerd : " + user.Name);
|
return Content("User has been registered : " + user.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Web.Http;
|
||||||
|
|
||||||
namespace WebApiCompatShimWebSite
|
namespace WebApiCompatShimWebSite
|
||||||
{
|
{
|
||||||
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatability.
|
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatibility.
|
||||||
[ActionSelectionFilter]
|
[ActionSelectionFilter]
|
||||||
public class EnumParameterOverloadsController : ApiController
|
public class EnumParameterOverloadsController : ApiController
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace WebApiCompatShimWebSite
|
namespace WebApiCompatShimWebSite
|
||||||
{
|
{
|
||||||
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatability.
|
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatibility.
|
||||||
[ActionSelectionFilter]
|
[ActionSelectionFilter]
|
||||||
public class ParameterAttributeController : ApiController
|
public class ParameterAttributeController : ApiController
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace WebApiCompatShimWebSite
|
namespace WebApiCompatShimWebSite
|
||||||
{
|
{
|
||||||
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatability.
|
// This was ported from the WebAPI 5.2 codebase. Kept the same intentionally for compatibility.
|
||||||
[ActionSelectionFilter]
|
[ActionSelectionFilter]
|
||||||
public class TestController : ApiController
|
public class TestController : ApiController
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue