在C#代码中调试Model类

时间:2016-11-24 13:33:26

标签: c# visual-studio-2015 visual-studio-debugging

我正在使用Oracle数据库处理Entity Framework。我有Long POCO类,我使用POCO生成工具生成。现在我收到Specified cast无效的错​​误

An exception of type 'System.InvalidCastException' occurred in mscorlib.dll but was not handled in user code

而且我知道错误是由于模型类中的某些属性,因为我已经找到了一个,但是类太大而且我想要在调试中启用以找到错误源,因为degugging告诉错误生成在我调用存储库方法的行,但我知道错误不存在,在模型类中,所以基本上我想调试告诉我属性名称发生转换错误

enter image description here

POCO类,其中错误实际为

[Table("abc.PEOPLE")]
public class PeopleEntity
{
    [Key]
    public int PERSON_CODE { get; set; }

    [StringLength(50)]
    public string FORENAME { get; set; }

    [StringLength(240)]
    public string MIDDLE_NAMES { get; set; }

   //remain attributes........... 

0 个答案:

没有答案