Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
135 views

I’m building an ASP.NET Core MVC application with a view model that contains a nullable enum, decimal and other int properties. Example: public class UserViewModel { public decimal? Amount { get; ...
Sean Treanor's user avatar
0 votes
2 answers
86 views

I have an ASP.NET Core 9.0 MVC project where I use DTOs for input binding and FluentValidation 12.x for validation. Entities exist separately and contain data annotations attributes like [Required] ...
enes durmuş's user avatar
0 votes
1 answer
36 views

This a continuation of this question: ASP.NET MVC Create View - Where to place ValidationMessage (Fluent Validation) for a variable ASP.NET MVC Firstly, all the validation rules are firing except the ...
Sally Parkes's user avatar
0 votes
1 answer
68 views

I have this validator class: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; using DocumentFormat.OpenXml.Linq; using ...
Sally Parkes's user avatar
2 votes
1 answer
67 views

Both Create and Edit views use the same validations controller. Create works correctly, showing error messages, and saves upon correcting any validation issues, taking you to the Index view. For the ...
Sally Parkes's user avatar
4 votes
1 answer
176 views

Validation framework: using FluentValidation; namespace ASValidation.Validators.Common { public static class CommonValidators { // Validates address: max 200 chars, allowed ...
Jayachandran's user avatar
0 votes
1 answer
69 views

Given these models: public class Foo { public int Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class FooOfType { public string TypeName ...
JHJ's user avatar
  • 421
0 votes
1 answer
73 views

I have a unit test that I pass RootContextData, i.e. var context = new ValidationContext<Person>(person); context.RootContextData["MyCustomData"] = "Test"; var validator = ...
JHJ's user avatar
  • 421
-1 votes
1 answer
41 views

FluentValidator's .SetValidator() method has an overload that takes params but I can't find any documentation about the use of those params. IRuleBuilderOptions<T, TProperty> SetValidator(...
JHJ's user avatar
  • 421
2 votes
2 answers
81 views

I have a record like this: public record UpdateRequest { public int? Prop1 { get; init; } public int? Prop2 { get; init; } public int? Prop3 { get; init; } } Using Fluent Validation, I ...
user007's user avatar
  • 1,798
2 votes
1 answer
64 views

I am trying to understand why my validation test is failing, when I expect it to pass. Here is the code: using FluentValidation; namespace FluentValidationIssue { public class Model { ...
mhsimkin's user avatar
  • 343
0 votes
0 answers
36 views

Currently i got this code: public static IRuleBuilderOptions<T, TProperty> NotEmptyWithName<T, TProperty>( this IRuleBuilder<T, TProperty> ruleBuilder, string fieldName, ...
Michiel Stragier's user avatar
0 votes
0 answers
25 views

Suppose I have a class Entity that has a list of strings as controls. I want to make sure each element of the list: 1- Has exactly one "/" in it. 2- It actually just separates two valid ...
user30225607's user avatar
1 vote
2 answers
143 views

I'm using fluent validation in my ASP.NET Core Web API. While this works perfectly for scenarios like empty or greater than scenarios, I want to validate database keys / ids. For example, while adding ...
Deepak kumar jain's user avatar
0 votes
1 answer
120 views

Is there a way to return multiple messages on one rule? public class EmployeeValidator : AbstractValidator<Employee> { public EmployeeValidator () { RuleFor(p => p.StartDate)....
blue pink's user avatar
1 vote
1 answer
113 views

I have an array of objects I am receiving in an HTTP Post body. Looks something like this: { load: { stops: [ { Name: "Stop 1", AppointmentDateTime:...
SpaceCowboy74's user avatar
-1 votes
1 answer
96 views

This is my query class: public class GetRolesQuery : GenericDetailsPaginatedQueryBase { public string[] OrganizationIds { get; set; } = []; public DateTime? FromDate { get; set; } public ...
Towhid's user avatar
  • 2,124
1 vote
1 answer
156 views

I'm working on a .NET 4.8 project and using FluentValidation v9.5.4. I can't update the version for reasons beyond my control. Using the example classes from FluentValidation docs: public class ...
JHJ's user avatar
  • 421
0 votes
0 answers
32 views

I am working on a project that has Razor pages, Mediatr, and FluentValidation in the tech stack. For one page, the Mediatr Command object contains a Dictionary similar to the following: public record ...
Ray Koziel's user avatar
0 votes
0 answers
53 views

Suppose I have the following domain models in a C# .NET 6 EF Core project: public abstract class BaseItem { // Base class implementation... } public class FooItem : BaseItem { // Derived ...
Matt Rogan's user avatar
0 votes
1 answer
47 views

This is for a .NET 8 blazor webapp. I have a grid that has an Editor Template as follows: <EditorTemplate> @{ CurrentlyEditedItemSupplier = (context as ItemSupplier)!; <HiSS.Body....
Rob Marsh's user avatar
  • 591
0 votes
1 answer
43 views

Im getting this error after i upgrade my fluent Validation package from 8.6.3 to 9.2.2 Could someone please help ? public class PolymorphicValidator<TBaseClass> : NoopPropertyValidator ...
F sam's user avatar
  • 61
1 vote
1 answer
149 views

We have a number of web api services that currently use FluentValidation and SharpGrip.FluentValidation.AutoValidation for automatic asynchronous validation. It works really well. At present the ...
tembojoe's user avatar
0 votes
0 answers
38 views

Consider I have a validator like this: public class validatorTest : AbstractValidator<model> public validatorTest() => _ = this.RuleFor(model => model.Name).NotNull().WithMessage("...
pouria vafaei's user avatar
1 vote
1 answer
69 views

My code, below, is a fluenteditform form. After I submit, it says that the fields still need to be filled out even though I filled them out. What is wrong with my code? @page "/movieform" @...
user3776241's user avatar
0 votes
1 answer
515 views

I am attempting to use Fluent Validator in my project. Most of the tutorials that I come so far is using with a post request where you have a json body as a object and that object will be validated by ...
Hoang Minh's user avatar
  • 1,282
-1 votes
1 answer
62 views

How can i add fluentvalidation which have validation in multiple assemblies. I have validators also in a shared class Library: public class TestModelValidator : AbstractValidator<TestModel> ...
user3552264's user avatar
0 votes
1 answer
69 views

I am trying to create a generic class for fluent validation. Refer the following code. public abstract class GenericValidator<T> : AbstractValidator<T> { /// <summary> /// ...
SPTD248's user avatar
-1 votes
1 answer
142 views

I am trying to validate a generic type: public class Request<T> where T : class { public int Test { get; set; } public List<T> Records { get; set; } = []; } How do I set the ...
Zulander's user avatar
  • 834
1 vote
1 answer
135 views

I have a single class public class Foo { public string Name { get; set;} public string Email { get; set;} public int Id { get; set;} } And my objective is to have 2 differents rules in a ...
Kaiwinta's user avatar
  • 309
1 vote
1 answer
79 views

In Fluent Validation, I have multiple validators on a single property, like so: RuleFor(c => c.MinSize) .GreaterThanOrEqualTo(limits.MinLimit) .LessThan(c => c.PreferredSize ?? limits....
void.pointer's user avatar
  • 26.7k
0 votes
1 answer
163 views

I'm replacing all exception with Result<T> by the LangExt library. The problem is ValidationBehavior doesn't even get triggered. It used to trigger when the method signature used to be public ...
nop's user avatar
  • 6,617
0 votes
1 answer
169 views

I am using MudBlazor form components to create a form. The form has some static components and some dynamic components. I am having trouble getting the dynamic components to validate. Form <...
baynezy's user avatar
  • 7,106
1 vote
1 answer
349 views

Let's say we have a few validators: RuleFor(request => request.User) .NotEmpty() .Must(Exist); RuleFor(request => request.Room) .NotEmpty() .Must(Exist); RuleFor(request => ...
Martin Teichler's user avatar
1 vote
0 answers
560 views

I'm trying Fastendpoints for organize endpoints in a .net8 web-api project. I have configured validators as follows Issue is when the app starts in local environment it shows the following fail ...
manura's user avatar
  • 93
1 vote
1 answer
148 views

Let's say that I have a type called Widget. Widget public class Widget { public int? Id { get; set; } public string? Name { get; set; } public List<Item>? Items { get; set; } } I ...
baynezy's user avatar
  • 7,106
0 votes
0 answers
91 views

I was looking at using Transform but it looks like it will be removed soon and a new way with computed properties is to be used. https://github.com/FluentValidation/FluentValidation/issues/2072 My ...
chobo2's user avatar
  • 86.2k
1 vote
1 answer
107 views

I have get web api where I need to write down fluent validation which we check user can only pass one query parameter. I have 2 parameters name as action and promo.where parameters types are boolean ...
Jai's user avatar
  • 11
1 vote
0 answers
72 views

If browser autocomplete two field in my register form (email + password) then validator always return true, but form has two others field (confirm password + terms). I can't find solution for this, ...
Arkadiusz S's user avatar
1 vote
1 answer
866 views

I am using Blazor Server, Fluent Validation and Blazored.FluentValidation. I have not really used Fluent Validation for front end for a very long time but I remember when I was using Jquery Validate + ...
chobo2's user avatar
  • 86.2k
0 votes
1 answer
137 views

Question: I'm using FluentValidation in my .NET application and have a custom validation method for phone numbers that uses .OverridePropertyName("phone_number"). The validation method works ...
Olawale Odeyemi CEOcodes's user avatar
1 vote
0 answers
734 views

I need to validate PinCode send from UI, this value need to check with database if not null. I have this code to validate using Fluent Validations: public class PinCodeValidator : AbstractValidator<...
Ramesh Bolla's user avatar
0 votes
0 answers
57 views

I have an endpoint that updates (PUTs) an entity. However, the entire class file is not required, only the property the requestor wants to change. How do I get FluentValidation to just validate the ...
Carlos's user avatar
  • 1,890
2 votes
1 answer
138 views

I have this code in an ASP.NET Core 8 Web API using Fluent Validation: public class CreateBranchBulkUploadCommand : IRequest<Response<string>> { public IFormFile File { get; set; } } ...
Gbenga's user avatar
  • 313
0 votes
1 answer
93 views

This is an up-to-date version of this question, as the solution no longer applies. I've implemented fluent validation and am now building tests. The developers of FluentValidations strongly suggest ...
awj's user avatar
  • 8,019
0 votes
0 answers
53 views

I need to have a validation summary with a anchor to the input control that have the error so the user can click on it and get into the input without having to "find" it the input have ...
Fredou's user avatar
  • 20.2k
1 vote
1 answer
74 views

In ASP.NET Core-8 Web API, I am implementing Custom Messages with Fluent Validation DTO: public class CreateAccountRequestDto { public int PreferredClassCode { get; set; } public DateTime ...
Gbenga's user avatar
  • 313
2 votes
1 answer
1k views

Preamble: This is a follow-up to an older question about .NET 4 and ASP.NET 5 with FluentValidation 8.5. While this could be considered a duplicate, enough has changed with FluentValidation over the ...
Greg Burghardt's user avatar
1 vote
0 answers
205 views

I'm using the package FastEndpoints ( which ships FluentValidation ). Given a class defining the request object using System.Text.Json.Serialization; namespace MyProj; public sealed class Request { ...
baitendbidz's user avatar
  • 1,009
1 vote
0 answers
88 views

I have a Boolean property 'AnyLetter' depending on five other Boolean properties. The fluent validation is working when I hit on submit but I would like it trigger like 'Location' property, when value ...
Sivakrishnan's user avatar

1
2 3 4 5
30