Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Use IValidationAttributeAdapterProvider #5036

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -99,7 +98,9 @@ public void CreateValidators(ClientValidatorProviderContext context)
// Add a default '[Required]' validator for generating HTML if necessary.
context.Results.Add(new ClientValidatorItem
{
Validator = new RequiredAttributeAdapter(new RequiredAttribute(), stringLocalizer),
Validator = _validationAttributeAdapterProvider.GetAttributeAdapter(
new RequiredAttribute(),
stringLocalizer),
IsReusable = true
});
}
Expand Down