コード例 #1
0
 /// <summary>
 /// Adds validation using FluentValidation.
 /// </summary>
 /// <param name="facility">The <see cref="ModelValidationFacility"/>.</param>
 /// <param name="configure"></param>
 /// <returns>The <see cref="ModelValidationFacility"/>.</returns>
 public static ModelValidationFacility UseFluentValidation(
     this ModelValidationFacility facility,
     Action <FluentValidationFacilityExtension> configure = null)
 {
     Ensure.Arg.NotNull(facility, nameof(facility));
     facility.AddExtension(configure);
     return(facility);
 }
コード例 #2
0
 /// <summary>
 /// Adds validation using <see cref="System.ComponentModel.DataAnnotations"/>.
 /// </summary>
 /// <param name="facility">The <see cref="ModelValidationFacility"/>.</param>
 /// <returns>The <see cref="ModelValidationFacility"/>.</returns>
 public static ModelValidationFacility UseDataAnnotations(this ModelValidationFacility facility)
 {
     Ensure.Arg.NotNull(facility, nameof(facility));
     facility.AddExtension <DataAnnotationsFacilityExtension>();
     return(facility);
 }