作者:Jie | 来源:互联网 | 2023-10-14 15:08
IhavethesituationwhereIminitializingmymodelinDatabaseInitializer()forEF4.1andgetthi
I have the situation where I'm initializing my model in DatabaseInitializer() for EF 4.1 and get this annoying error "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details."
So, I go to this EntityValidationErrors and there is a field {System.Data.Entity.Validation.DbEntityValidationResult}
which gives me no information at all about what field it was unable to initialize. Is there a way to get more info about this error?
我有这样一种情况:我正在为EF 4.1在DatabaseInitializer()中初始化我的模型,却发现一个或多个实体的这个烦人的错误“验证失败了。有关更多细节,请参见'EntityValidationErrors'属性。因此,我转到EntityValidationErrors,这里有一个字段{System.Data.Entity.Validation。DbEntityValidationResult},它对无法初始化的字段没有任何信息。是否有办法获得关于这个错误的更多信息?
To clear things out:
明确的事情:
I know how to fix the string length problem. What I'm asking is how do I get the exact field name that is breaking the model.
我知道如何解决字符串长度问题。我要问的是,如何得到一个准确的字段名来打破模型。
5 个解决方案