Closed mark-pro closed 1 year ago
The idea presented would all for the use of an attribute to be used to indicate that the function should be validated with a FluentValidation.IValidator<T>
.
Attribute could be named:
ValidationFilterAttribute<TypeToFilter>
ValidateAttribute<TypeToFilter>
record Echo(string Message);
[Validate<Echo>]
[MapGet("api/echo")]
string echo([AsParameters] Echo e) => e.Message;
Final design for attribute usage; both are now applicable.
record Echo(string Message);
[ValidateParam(typeof(Message))]
[HttpGet("api/echo")]
string echo([AsParameters] Eche e) => e.Message
record Echo(string Message);
[HttpGet("api/echo")]
string echo([Validate, AsParameters] Eche e) => e.Message
Consider using or merging
Genesis.MinimalApis.Validation
withGenesis.MinimalApis
so thatAttributes
might be used to provideFluentValidation
filtering on parameters.