开发者

Why I am not able to assign Default value ot my property using MVC2 in my asp.net mvc application

开发者 https://www.devze.com 2023-02-18 13:39 出处:网络
I have this code in my class [MetadataType(typeof(HipaaBenefit_Metadata))] public partial class HipaaBenefit

I have this code in my class

[MetadataType(typeof(HipaaBenefit_Metadata))]
    public partial class HipaaBenefit
    {
        public class HipaaBenefit_Metadata
        {
            [DefaultValue("")]
            public string TimePeriodQualifierEb06 { get; set; }

            [DefaultValue("")]
            public string NetworkIndicatorEb12 { get; set; }

            [DefaultValue("")]
            public string BenefitAmountEb07 { get; set; }
        }
    }

In my Database table these columns are not null fields. when I am trying to save the data from codebehid to table I a开发者_StackOverflowm trying to assign these column values as Empty.String.

But some reasons I am not able to send this Empty.String values to the table?

is that something I am doing wrong in this code? if so how to assign the default values?

Thanks


Did you tryied to set default value as NULL?

[DefaultValue("Null")]

0

精彩评论

暂无评论...
验证码 换一张
取 消