asp.net mvc - System.data.entity.validation.DbEntityValdationException Error Come when save the data -
this controller
public jsonresult savebillingsystemparameters(billingsystemparameters model) { var id = -1; //initialize newid variable var userid = helpers.getloggedinuserid(); var currentdate = helpers.getinvariantculturedatetime(); var defaultcorporateid = helpers.getsysadmincorporateid(); //check if model not null if (model != null) { using (var bal = new billingsystemparametersbal()) { model.corporateid = defaultcorporateid; if (model.id > 0) { model.modifiedby = userid; model.modifieddate = currentdate; } else { model.createdby = userid; model.createddate = currentdate; model.corporateid = helpers.getsysadmincorporateid(); } //call addbillingsystemparameters method add / update current billingsystemparameters id = bal.savebillingsystemparameters(model); } } return json(id); } //bal class public int savebillingsystemparameters(billingsystemparameters model) { using (var rep = unitofwork.billingsystemparametersrepository) { if (model.id > 0) { var current = rep.getsingle(model.id); model.createdby = current.createdby; model.createddate = current.createddate; rep.updateentity(model, model.id); } else rep.create(model); return model.id; } } i getting following error 
do exception message says, inspect entityvalidationerrror exception means you're trying break constraint varchar filed width if browse through param you'll more details on type of constrain savechanges() tried brake
Comments
Post a Comment