'xyz'上的'abc'属性无法设置为'Int32'值。您必须将此属性设置为类型为“Boolean”的非null值

时间:2015-10-08 09:08:05

标签: entity-framework stored-procedures model-view-controller nullable

我正在尝试让函数导入正常工作。 EF调用我的存储过程,但结果有一个我不明白的内部异常:

  

'uspLoadTemplateByID_Result'上的'IsPublished'属性无法设置为'Int32'值。您必须将此属性设置为a   “布尔”类型的非空值。

我的designer.cs是

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Boolean> IsPublished
        {
            get
            {
                return _IsPublished;
            }
            set
            {
                OnIsPublishedChanging(value);
                ReportPropertyChanging("IsPublished");
                _IsPublished = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("IsPublished");
                OnIsPublishedChanged();
            }
        }
        private Nullable<global::System.Boolean> _IsPublished;
        partial void OnIsPublishedChanging(Nullable<global::System.Boolean> value);
        partial void OnIsPublishedChanged();

0 个答案:

没有答案