Fluent Validation in C# - The Powerful Yet Easy Data Validation Tool

Fluent Validation in C# - The Powerful Yet Easy Data Validation Tool

IAmTimCorey

5 лет назад

130,215 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Alaa Mohammed
Alaa Mohammed - 16.03.2023 15:51

if I did have the same rule for multiple proprieties (with only different parameters like max Length), Is there a way I could make a delegate or any think like this that could point at the same rule. And use it with different proprieties and there corresponding parameters.
As it will be easier to make everything consistent, in case I wanted to change anything in the rule itself. Specially, that I have many Models and Dto that use the same rule.
Thanks.

Ответить
devoiddude
devoiddude - 20.02.2023 02:25

This fantastic stuff, really made me rethink how I do validation, I was just using if statments every where, this is much better, thank you sir!

Ответить
Eric ten Westenend
Eric ten Westenend - 19.09.2022 15:53

How to set focus to the first invalid element?

Ответить
Eric ten Westenend
Eric ten Westenend - 12.09.2022 12:24

what if first name = ' '

Ответить
shahzad ali
shahzad ali - 10.09.2022 10:29

This is a great video done sir

Ответить
nihal latif
nihal latif - 21.07.2022 22:29

Can we pass a list of errors in the message?

Ответить
Nick
Nick - 13.07.2022 12:26

Can you do conditional rules like first name and last name both can be empty, but if last name is not empty then first name cannot be empty

Ответить
javad jannesari
javad jannesari - 21.06.2022 18:54

gooood

Ответить
Hung
Hung - 17.06.2022 17:21

Can fluent validation be used with WPF data binding?

Ответить
Gocha Darjania
Gocha Darjania - 03.06.2022 03:10

Thanks for this video!

Ответить
RASHID SELEMANI
RASHID SELEMANI - 30.05.2022 23:25

I don’t have comments, I’m speechless Sir!!!

Ответить
Chamith Shehan
Chamith Shehan - 25.05.2022 04:39

Blog post link does not work. It always redirects to homepage

Ответить
Mo Fathy
Mo Fathy - 24.05.2022 12:55

would you kindly allow the source code again?

Ответить
Rômulo Magalhães
Rômulo Magalhães - 23.05.2022 20:22

Simply useful. Thank you very much Tim.

Ответить
Sadede Gel
Sadede Gel - 22.05.2022 22:56

Great!

Ответить
Nadine Mousa
Nadine Mousa - 22.03.2022 15:53

You're really making it easy not only to learn C#, but also important programming concepts. Than you!

Ответить
David Martin
David Martin - 25.02.2022 01:19

Is this related to Blazored.FluentValidation (from Chris Sainty)?

Ответить
Janice Bridle
Janice Bridle - 21.01.2022 17:59

Is there a way to define the alignment of the data validation memo...the leftmost column ends up cutting off half the memo box

Ответить
Ganesh B
Ganesh B - 21.01.2022 14:13

Fluent validation is very useful I have used it in my project as server-side validation. Thank you Tim for
most valuable content and learning video .

Ответить
CaraHero
CaraHero - 09.01.2022 07:01

is it possible to use dependency injection as it was a normal class? I mean I have a couple of entities to inject, should I use dependency injection as always?

Ответить
Sagar Harale
Sagar Harale - 31.12.2021 22:56

Really nice video, helps to reduce a lot of dirty code 👌

Ответить
Pierre Plourde
Pierre Plourde - 24.12.2021 16:58

This one is worth the price of admission!! Great video and good information.

Ответить
Last Idea
Last Idea - 16.12.2021 22:32

TotalLength doesn't work and I don't know why there is no solution

Ответить
Brian Viktor
Brian Viktor - 12.10.2021 23:04

Just a little off-topic hint: When you do: "if (condition) return true; else return false;"
You can simply do instead: "return condition;"

Ответить
Gaëtan Dezeiraud
Gaëtan Dezeiraud - 06.10.2021 16:53

Thanks, useful! Not possible to show the error in real-time under the associated TextBox? More user-friendly.

Ответить
Darryl Wagoner
Darryl Wagoner - 04.10.2021 20:04

Great video. It would be nice to have one using Blazor.

Ответить
HomeIG
HomeIG - 23.09.2021 16:14

Any idea how to integrate validation for a combobox? I am trying to set the code so there has to be a selection from the combobox to pass validation

Ответить
Patrick
Patrick - 22.08.2021 21:35

This is a lesson I've overlooked over and over and guess what, I am actually redoing validation in my Application albeit a year after deployment! Well, Thank you Tim!

Ответить
Ali İhsan Elmas
Ali İhsan Elmas - 09.08.2021 19:23

Thanks for this great video! But the link for source code on one drive is not valid anymore. Can you share it again? Thanks.

Ответить
Gregory Pacheco
Gregory Pacheco - 04.08.2021 23:06

The problem with Fluent Validation is that it is only useful on the UI layer to make sure UI doesn't break the contract of the Application layer. Outside of UI layer this sort of validation belongs to the domain layer which should not have a dependency on any external resources.

Ответить
Darrell Robert Parker
Darrell Robert Parker - 24.07.2021 01:40

Great Course thanks! Do you do personal trainings as well?

Ответить
Dmitri Pankov
Dmitri Pankov - 16.07.2021 14:47

Thanks Tim, you are amazing !

Ответить
Moe
Moe - 02.06.2021 23:38

There is no link to the source code. Could you pleas attach it?

Ответить
Scot Olivera
Scot Olivera - 25.05.2021 17:44

Thank you, just what i was looking for

Ответить
Rafael Santos
Rafael Santos - 18.05.2021 13:44

I think it would be better to have the error message popping up as a tooltip inside the field.

Ответить
cg cg
cg cg - 18.03.2021 14:22

Nice, I didn't know about fluent. Would you care to take a look at the one I did? It's called rainsoft validations and it's both in nuget and github.

Ответить
Saleh
Saleh - 14.03.2021 17:45

THANK YOU!

Ответить
kartheek nandini
kartheek nandini - 06.03.2021 19:14

Can you please do videos on MediatR

Ответить
Neralem
Neralem - 05.03.2021 00:23

DateTime as well as TimeSpan have their < > operators overloaded. So you can easy tell which one is "greater". You can also subtract a DateTime from another one. This will return you a TimeSpan.

Ответить
Neralem
Neralem - 04.03.2021 23:49

So you say if I'm a vampire I can't use your software because I can't enter my date of birth?! Thats not okay! And time travelers also can not??

Ответить
Iwky
Iwky - 28.02.2021 21:36

I do not understand the point of this though as this only would work for text or string data, if I want to validate numbers or non-nullable fields I have to validate them beforehand like an int value cannot be null or will not accept letters, and I have to d that for every non-nullable field

Ответить
dheeraj ambippi
dheeraj ambippi - 28.02.2021 18:24

hi Tim, this was great video but i was searching on data Sanitization in .net core 3.1 like sql injection and Html tags. plz help me

Ответить
DodgerDude®
DodgerDude® - 23.02.2021 08:13

A+++++ Thanks! Great video to get a person started; especially the last segment where you give the idea of creating all of your custom validation rules that return true/false and putting them in a local Nuget package to share.

Ответить
Khoa Doo
Khoa Doo - 19.02.2021 11:52

Hi Tim,
Is there a way that I can reuse validation from PersonModel to CreatePersonModel without checking field ID?

Ответить
Greg Bryant
Greg Bryant - 08.02.2021 14:58

Hi Tim, I love your videos, but it would be lovely to have Advance Fastrack version of these videos for reference.

Ответить
vignesh baraman
vignesh baraman - 04.02.2021 10:03

Hi Tim,
In Fluent validation how to restrict a fields as only number

Ответить
Andrei Rosu
Andrei Rosu - 27.01.2021 00:14

Hi Tim,
I have some struggles validating a BindableCollection<MyModel> . Is that even possible with FluentValidation?
What I mean is:
- I have a DataGrid binded to a BindableCollection<Model>
- Inside my model i have a string property (which will be binded to a DataGridTextColumn)

What I would like to achieve is to validate that column for duplicates entries.
I have a hard time with it.

Any tips?

Thanks in advance!

Ответить
ore_bear
ore_bear - 21.01.2021 16:50

I downloaded the startcode, but it has no dependencies so I can't add reference and download the fluent. Anybody have experienced the same?

Ответить
MOMEDES GOMES DE BRITO JUNIOR
MOMEDES GOMES DE BRITO JUNIOR - 16.01.2021 03:58

Hello! I'm searching for fluent interfaces and I found fluent interfaces is bad for encapsulation and other OO concepts. Can someone say if it's true and what does that means? Thanks!

Ответить
Jürgen Bartalis
Jürgen Bartalis - 14.01.2021 13:23

What a brilliant and helpful video! I hope I get it adapted in WPF.

Ответить