ASP NET Core model validation

  Рет қаралды 114,386

kudvenkat

kudvenkat

Күн бұрын

Пікірлер: 47
@artak9439
@artak9439 5 жыл бұрын
5:50 Instead of Regular Expression we can use [EmailAddress] validation attribute for email format validation.
@get_ready
@get_ready 5 жыл бұрын
Pretty slick, thanks for sharing!
@sephiroth4488
@sephiroth4488 4 жыл бұрын
MVP
@AmirKMilbes
@AmirKMilbes 4 жыл бұрын
I have to disagree with this. [EmailAddress] allows entries like "Peter@test" which of course is missing the .something part. So ultimately, Venkat's RegularExpression version is better.
@NiazMohammad
@NiazMohammad 4 жыл бұрын
@@AmirKMilbes Even that regex is not good enough. it's just a format checker of the form abc@a.b; not an actual domain or email service provider checker. However, yes u r right, the regex by Venkat is better than [EmailAddress]
@abdelrahmanahmed7777
@abdelrahmanahmed7777 3 жыл бұрын
you can use System.Net.Mail as a type for Employee Email property instead of string
@GavinLon
@GavinLon 5 жыл бұрын
I really appreciate your teaching style.
@hetalchavan7379
@hetalchavan7379 4 жыл бұрын
at 8:20, after using [MaxLength(50,ErrorMessage ="Name can not exceed 50 characters")], it is not showing a validation message. Instead, it does allow user to enter more than 50 characters.(.net core 3.1)
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
I think you mean 'it does *not* allow user to enter....'?
@namanvohra8262
@namanvohra8262 3 жыл бұрын
@@conaxlearn8566 It does allow
@anupambhardwaj7559
@anupambhardwaj7559 4 жыл бұрын
very helpful for beginners each an every topic explained very clearly
@gaganmudvari1553
@gaganmudvari1553 5 жыл бұрын
waiting for you next video. great series . thank you vankat.
@pravendramsc
@pravendramsc 5 жыл бұрын
Venkat Sir, your way to describe concept is fabulous thanks put your efforts
@DarkGT
@DarkGT 5 жыл бұрын
Simply fantastic! As always.
@sakthir3892
@sakthir3892 5 жыл бұрын
Dear Venkat sir, Thanks for effort to put videos.. keep rocking ...
@dangkolache
@dangkolache 5 жыл бұрын
Venkat, thank you as always. I have a question - if I am using EF Core, typically people do not use interfaces so you would pass along your db entity as your model properties. However, what if I only wanted to require certain values only on certain viewmodels? I cannot put the validation decorator on the db entity because then every viewmodel would use those decorators. Prior to using EF core, I would use an interface to create another class, but I do not have an interface with EF Core. Do I have to manually make a new class and manually map it to my db entity? Or use something like automapper? Or is there a cleaner way?
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
2:36 In later videos, if(ModelState.IsValid) was not used for adding and editing records. I've tried removing this check in the HomeController Create action and validation still works. So I don't know what this check is really being used for.
@hemantagrawal1122
@hemantagrawal1122 Жыл бұрын
the validations are not working for me if i'm removing this if statement
@TT-ud5gf
@TT-ud5gf 4 жыл бұрын
Where can we find a list of all possible attributes to use? Which keyword should I search MSDN?
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
This is how you find all attributes: 1. In the Employee model class, right-click on the [Required] attribute, then select 'Go to definition'. 2. Note that the RequiredAttribute class belongs to System.ComponentModel.DataAnnotations. 3. Google System.ComponentModel.DataAnnotations. The first result link should be the one you want to click into. 4. Just in case it did not get you there, here's the link: docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations?view=net-5.0
@harshsugandhi07
@harshsugandhi07 10 ай бұрын
I have a question, how do I perform validation on DropDown that we have created ?
@roadtripping
@roadtripping 2 жыл бұрын
At 9:45 I'm confused. In the Create actionmethod, you are returning View(); without any model. Yet when you post the form, all of your original inputs are persisted across posts - and the validation information is sent back too - but you never returned the model back with the view! You only did return View(); and not return View(employee); I wonder how your original data is being persisted across post backs?
@hemantagrawal1122
@hemantagrawal1122 Жыл бұрын
it was not returning the Index method, it just simply return the create method
@aaravbhadani5195
@aaravbhadani5195 5 жыл бұрын
you are legendary man!!
@puneetkankar
@puneetkankar 5 жыл бұрын
This is very helpful thanks..
@VivekKumar-nt9wy
@VivekKumar-nt9wy 5 жыл бұрын
Sir Thanks a lot for your amazing effort
@rohanrvs
@rohanrvs 5 жыл бұрын
Do we have something like validation group property in dot net core. Something similar to validation controls in asp.net
@robmays6982
@robmays6982 5 жыл бұрын
very enjoyable
@usamabaloch6178
@usamabaloch6178 4 жыл бұрын
[Required, MaxLength(50, ErrorMessage = "Name cannot exceed 50 characters")] is not working :( in asp.net core 3.1
@yasirirfan5262
@yasirirfan5262 7 ай бұрын
thumbs up
@rpabeginners4576
@rpabeginners4576 5 жыл бұрын
Thank you sir, i have problem in dropdownlist validations
@coolwaterdvr
@coolwaterdvr 5 жыл бұрын
Thanks Venkat.
@nasirkiyani4356
@nasirkiyani4356 5 жыл бұрын
Thank you so much sir.
@RachitJain4U
@RachitJain4U 3 жыл бұрын
Thanks Sir :)
@naodagere8210
@naodagere8210 4 жыл бұрын
Thanks
@MmMm-tg5mq
@MmMm-tg5mq 5 жыл бұрын
thanx thanx thanx
@darkogele
@darkogele 5 жыл бұрын
LOVE U MAN !!! not in a gay way do :D
Select list validation in asp net core
5:37
kudvenkat
Рет қаралды 90 М.
AddSingleton vs AddScoped vs AddTransient
15:23
kudvenkat
Рет қаралды 217 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
ASP NET Core Model Binding
12:31
kudvenkat
Рет қаралды 150 М.
Attribute Routing in ASP NET Core MVC
14:14
kudvenkat
Рет қаралды 147 М.
(#50) Model validations in asp.net core | Asp.Net Core tutorial
20:21
Edit identity user in asp net core
17:14
kudvenkat
Рет қаралды 53 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 283 М.
Add or remove users from role in asp net core
24:30
kudvenkat
Рет қаралды 85 М.
FluentValidation for Powerful ASP.Net Core Model Validation | Tutorial
13:23
File upload in asp net core mvc
23:12
kudvenkat
Рет қаралды 189 М.
ASP NET Core LogLevel configuration
15:45
kudvenkat
Рет қаралды 61 М.