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

Commit

Permalink
Use IValidationAttributeAdapterProvider
Browse files Browse the repository at this point in the history
- #5009
- don't create a `RequiredAttributeAdapter` directly
  • Loading branch information
dougbu committed Jul 18, 2016
1 parent e5cb6f9 commit c52eaa2
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit c52eaa2

Please sign in to comment.