All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aspnet-fastendpoints.request.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{#useValidators}}using FluentValidation;{{/useValidators}}
using {{packageName}}.Models;

namespace {{packageName}}.{{apiPackage}};

{{#useRecords}}{{>requestRecord}}{{/useRecords}}
{{^useRecords}}{{>requestClass}}{{/useRecords}}

{{#useValidators}}
{{#operations}}{{#operation}}
public class {{operationId}}RequestValidator : FastEndpoints.Validator<{{operationId}}Request>
{
    public {{operationId}}RequestValidator()
    {
    {{#requiredParams}}
        RuleFor(x => x.{{#isBodyParam}}{{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{nameInPascalCase}}{{/isBodyParam}}).NotEmpty();
    {{/requiredParams}}
    }
}

{{/operation}}{{/operations}}
{{/useValidators}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy