Questions tagged as 'model-validation'

1
answer

When should I use ModelState.IsValid?

When should I use ModelState.isValid ? Is it just in the data insertion? And in the case of update and delete ? It's needed?     
asked by 21.06.2016 / 02:25
1
answer

EF6 EntityValidationErrors error in filled property

I am having a similar problem in two ASP.NET applications with Entity Framework. When I try to update an entity that already has all the required mandatory attributes I get a EntityValidationErrors exception, however this property that...
asked by 14.05.2015 / 19:13
1
answer

Validate composite key with Laravel?

I have a table where the employees of a company with the following fields are inserted; id , name , email , use_id , role_id .    user_id is the id of the company that the official works. The v...
asked by 25.08.2017 / 17:55
1
answer

Validation of dates in the Asp Net Core model?

I have a template and wanted to validate the end date (which should be equal to or greater than the start date) public class MyModel { [Key] public int ModelId { get; set; } [Display(Name = "Início")] [DisplayFormat(DataFormat...
asked by 15.08.2017 / 17:23
1
answer

DataAnnotation: How to validate "e-mail" property, check whether or not it exists in the database, with attribute not being in the client but in the Server

I have a layered application, and in my presentation layer, I have a ViewModel that is UsuarioViewModel within this I have a property call public email {get; set;} . > that is being registered already exists in...
asked by 05.01.2015 / 21:39
1
answer

Cause form validation in an asp.net mvc 5 link

Good afternoon everyone! I have a form, I created the rules using DataNotations and it works great when I use a button or input type submit inside my form. Very well! I want to change this button to a link that will call the ajax functi...
asked by 22.06.2015 / 19:03
1
answer

How do I accept 0 and negative values in decimal attribute using DataAnnotations?

I have a class with decimals that can receive a value of -10.00 to 10.00 ( including 0 ), equivalent is a numeric (5.2) . The problem is that when creating my MetaData class, even specifying the range validation has not worked. Home Not...
asked by 29.07.2015 / 15:34
2
answers

Validation model always fails

I have the following templates: public class Local { [Key] public int Id { get; set; } public virtual Grupo Grupo { get; set; } } public class Grupo { [Key] public int Id { get; set; } [Required] public int? Loc...
asked by 11.09.2014 / 20:23
1
answer

Laravel validator require

When you put the required option in the validation rules of Laravel $validator=\Validator::make($request->all(),['po_bairro'=>'require|string|min:5|max:50']); It requires you to have the value to continue the program....
asked by 16.03.2018 / 15:45
1
answer

problem with validation in Java

I'm implementing validationBean in my project, and I'm having a hard time validating a field, but apparently everything is fine in the settings I made in my project as you can see: Package: <dependency> <groupId>org.hibernat...
asked by 22.09.2015 / 17:17