Skip to main content

Questions tagged [fluentvalidation]

Fluent Validation is an ASP.NET MVC integrated validation framework that allows the developer to set validation rules using expressions. It is testable and completely compatible with the inversion of control (dependency injection) pattern and TDD (test-driven development) technique.

fluentvalidation
Filter by
Sorted by
Tagged with
Best practices
0 votes
3 replies
96 views

I have the following command to create an instance of the domain model: ...
McLaren's user avatar
  • 67
0 votes
2 answers
185 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: ...
Sean Treanor's user avatar
0 votes
2 answers
95 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 ...
enes durmuş's user avatar
0 votes
1 answer
39 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
71 views

I have this validator class: ...
Sally Parkes's user avatar
2 votes
1 answer
70 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
0 votes
1 answer
84 views

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

I have a unit test that I pass RootContextData, i.e. ...
JHJ's user avatar
  • 421
-1 votes
1 answer
45 views

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

I have a record like this: ...
user007's user avatar
  • 1,808
2 votes
1 answer
65 views

I am trying to understand why my validation test is failing, when I expect it to pass. Here is the code: ...
mhsimkin's user avatar
  • 343
0 votes
0 answers
39 views

Currently i got this code: ...
Michiel Stragier's user avatar
0 votes
0 answers
26 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 ...
user30225607's user avatar
1 vote
2 answers
179 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
126 views

Is there a way to return multiple messages on one rule? ...
blue pink's user avatar
1 vote
1 answer
128 views

I have an array of objects I am receiving in an HTTP Post body. Looks something like this: ...
SpaceCowboy74's user avatar
-1 votes
1 answer
102 views

This is my query class: ...
Towhid's user avatar
  • 2,134
1 vote
1 answer
170 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: ...
JHJ's user avatar
  • 421
0 votes
0 answers
55 views

Suppose I have the following domain models in a C# .NET 6 EF Core project: ...
Matt Rogan's user avatar
0 votes
1 answer
53 views

This is for a .NET 8 blazor webapp. I have a grid that has an Editor Template as follows: ...
Rob Marsh's user avatar
  • 591
0 votes
1 answer
47 views

Im getting this error after i upgrade my fluent Validation package from 8.6.3 to 9.2.2 Could someone please help ? ...
F sam's user avatar
  • 61
1 vote
1 answer
166 views

We have a number of web api services that currently use FluentValidation and SharpGrip.FluentValidation.AutoValidation for ...
tembojoe'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? ...
user3776241's user avatar
0 votes
1 answer
548 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
63 views

How can i add fluentvalidation which have validation in multiple assemblies. I have validators also in a shared class Library: ...
user3552264's user avatar
0 votes
1 answer
76 views

I am trying to create a generic class for fluent validation. Refer the following code. ...
SPTD248's user avatar
-1 votes
1 answer
150 views

I am trying to validate a generic type: ...
Zulander's user avatar
  • 834
1 vote
1 answer
184 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 ...
Kaiwinta's user avatar
  • 309
1 vote
1 answer
81 views

In Fluent Validation, I have multiple validators on a single property, like so: ...
void.pointer's user avatar
  • 26.8k
0 votes
1 answer
184 views

I'm replacing all exception with Result<T> by the LangExt library. The problem is ValidationBehavior doesn't even get ...
nop's user avatar
  • 6,627
0 votes
1 answer
180 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,116
1 vote
1 answer
407 views

Let's say we have a few validators: ...
Martin Teichler's user avatar
1 vote
1 answer
111 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
75 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
933 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
144 views

Question: I'm using FluentValidation in my .NET application and have a custom validation method for phone numbers that uses ...
Olawale Odeyemi CEOcodes's user avatar
1 vote
0 answers
776 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: ...
Ramesh Bolla's user avatar
0 votes
0 answers
60 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
141 views

I have this code in an ASP.NET Core 8 Web API using Fluent Validation: ...
Gbenga's user avatar
  • 323
0 votes
1 answer
104 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
58 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: ...
Gbenga's user avatar
  • 323
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
210 views

I'm using the package FastEndpoints ( which ships FluentValidation ). Given a class defining the request object ...
baitendbidz's user avatar
  • 1,019
1 vote
0 answers
104 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
0 votes
0 answers
44 views

I am developing an ASP.NET Core project. I am using MSSQL as a database. In my database, there is a Explanation column in my table named Inventory and this column can be left nullable. But I get an ...
Gökmen Ada's user avatar
0 votes
1 answer
108 views

I'm trying to set validator for Address depends on item existence, but I wanna use RuleFor and other handy methods rather that manually log every error with ...
Yara's user avatar
  • 29
0 votes
1 answer
3k views

I'm trying to validate input parameter for my endpoints. I want to use FluentValidator and here is the logic ...
Dragan Milovac's user avatar
1 vote
0 answers
33 views

My Razor Page project implement CQRS and FluentValidation, every Command or Query needs to be added in the Program.cs class like this: builder.Services.AddScoped<IValidator < GetPhonesQuery >...
J003_'s user avatar
  • 47

1
2 3 4 5
30