c# - Error while inserting duplicate records -
i have code commit public retornodto commit(efdbcontext _context) { string errovalidation = string.empty; try { _context.savechanges(); } catch (dbentityvalidationexception e) { foreach (var eve in e.entityvalidationerrors) { var erro = string.format("entity of type \"{0}\" in state \"{1}\" has following validation errors:", eve.entry.entity.gettype().name, eve.entry.state); logger.getinstance().erro(erro); foreach (var ve in eve.validationerrors) { errovalidation = string.format("- property: \"{0}\", error: \"{1}\"", ve.propertyname, ve.errormessage); logger.getinstance().erro(errovalidation); } } return new retornodto ...