Skip to content

Commit 0d91665

Browse files
committed
Docs tweaks and package generator in shared framework
1 parent 18b4939 commit 0d91665

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
Private="false"
7777
OutputItemType="AspNetCoreAnalyzer"
7878
ReferenceOutputAssembly="false" />
79+
80+
<ProjectReference Include="$(RepoRoot)src\Http\Http.Extensions\gen\Microsoft.AspNetCore.Http.ValidationsGenerator\Microsoft.AspNetCore.Http.ValidationsGenerator.csproj"
81+
Private="false"
82+
OutputItemType="AspNetCoreAnalyzer"
83+
ReferenceOutputAssembly="false" />
7984
</ItemGroup>
8085

8186
<ItemGroup>

src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Microsoft.AspNetCore.Http.Validation;
77

88
/// <summary>
9-
/// Resolves validation type information for a given type.
9+
/// Provides an interface for resolving the validation information associated
10+
/// with a given <seealso cref="Type"/> or <seealso cref="ParameterInfo"/>.
1011
/// </summary>
1112
public interface IValidatableInfoResolver
1213
{

src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ public ValidatableParameterInfo(
7878
/// Validates the parameter value.
7979
/// </summary>
8080
/// <param name="value">The value to validate.</param>
81-
/// <param name="context"></param>
81+
/// <param name="context">The context for the validation.</param>
82+
/// <returns>A task representing the asynchronous operation.</returns>
83+
/// <remarks>
84+
/// If the parameter is a collection, each item in the collection will be validated.
85+
/// If the parameter is not a collection but has a validatable type, the single value will be validated.
86+
/// </remarks>
8287
public Task Validate(object? value, ValidatableContext context)
8388
{
8489
Debug.Assert(context.ValidationContext is not null);

src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public ValidatablePropertyInfo(
8787
/// Validates the member's value.
8888
/// </summary>
8989
/// <param name="obj">The object containing the member to validate.</param>
90-
/// <param name="context"></param>
90+
/// <param name="context">The context for the validation.</param>
91+
/// <returns>A task representing the asynchronous operation.</returns>
9192
public Task Validate(object obj, ValidatableContext context)
9293
{
9394
Debug.Assert(context.ValidationContext is not null);

src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ public static class ValidationServiceCollectionExtensions
1313
/// <summary>
1414
/// Adds the validation services to the specified <see cref="IServiceCollection" />.
1515
/// </summary>
16-
/// <param name="services"></param>
17-
/// <param name="configureOptions"></param>
18-
/// <returns></returns>
16+
/// <param name="services">The <see cref="IServiceCollection" /> to add the services to.</param>
17+
/// <param name="configureOptions">An optional action to configure the <see cref="ValidationOptions"/>.</param>
18+
/// <returns>The <see cref="IServiceCollection" /> for chaining.</returns>
1919
public static IServiceCollection AddValidation(this IServiceCollection services, Action<ValidationOptions>? configureOptions = null)
2020
{
2121
if (configureOptions is null)
2222
{
23+
services.Configure<ValidationOptions>(_ => { });
2324
return services;
2425
}
2526

0 commit comments

Comments
 (0)