zoukankan      html  css  js  c++  java
  • Unable to cast object of type 'System.Int32' to type 'System.Array'.

    x

    入职了新公司、最近比较忙...一看博客...更新频率明显少了...罪过罪过...

    新公司用ASP.NET MVC

    遇上一个错误:

     Unable to cast object of type 'System.Int32' to type 'System.Array'.
    说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
    
    异常详细信息: System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.Array'.

    x

    原来是实体类限制的原因

    实体类:
    
    
    
            //[MaxLength(50000), MinLength(1)]
            public int 一个为Int类型的属性{ get; set; }
    为Int类型的属性是不能做MaxLength的限制的,除非他是数组...!!!!

    x

  • 相关阅读:
    GO 函数的参数
    GO 函数
    GO 指针
    GO 结构体
    GO 接口
    码云git常用命令
    GO Map的初步使用
    GO Slice
    GO 数组
    GO 键盘输入和打印输出
  • 原文地址:https://www.cnblogs.com/love-zf/p/6691497.html
Copyright © 2011-2022 走看看