• DataContact Protection



    sting , not null

     string XXXXXXX;

            [DataMember(IsRequired = true)]

            public string XXXXXXX //30,r

            {

                get { return XXXXXXX; }

                set

                {

                    if ((value + "").Length == 0)

                    {

                        string strMessage = ("XXXXXXXThe XXXXXXX should not be null or empty string.");

                        ModelContext.RecordException(string.Empty, strMessage);

                    }

                    int iLengthLimit = 30;

                    if ((value + "").Length > iLengthLimit)

                    {

                        string strMessage = ("XXXXXXXThe length of XXXXXXX should be limited to " + iLengthLimit + " characters.");

                        ModelContext.RecordException(string.Empty, strMessage);

                    }

                    XXXXXXX = (value + "").Length == 0 ? null : value.Trim();

                }

            }

    string , null

        string XXXXXXXXX;

            [DataMember]

            public string XXXXXXXXX //30,r

            {

                get { return XXXXXXXXX; }

                set

                {

                    int iLengthLimit = 30;

                    if ((value + "").Length > iLengthLimit)

                    {

                        string strMessage = ("XXXXXXXXXêoThe length of XXXXXXXXX should be limited to " + iLengthLimit + " characters.");

                        ModelContext.RecordException(string.Empty, strMessage);

                    }

                    XXXXXXXXX = (value + "").Length == 0 ? null : value.Trim();

                }

            }

    other object , not null

        DateTime XXXXXXXXX;

            [DataMember(IsRequired = true)]

            public DateTime XXXXXXXXX //=

            {

                get { return XXXXXXXXX; }

                set

                {

                    if ((value + "").Length == 0)

                    {

                        string strMessage = ("XXXXXXXXXThe XXXXXXXXX should not be null .");

                        ModelContext.RecordException(string.Empty, strMessage);

                    }

                    XXXXXXXXX = value;

                }

            }

     

  • 相关阅读:
    Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
    python 对数函数
    Python使用os.listdir()函数来得目录内容的介绍
    Linux下基于HTTP协议带用户认证的GIT开发环境设置
    在python中如何设置当前工作目录
    Python 获得命令行参数的方法
    Python time mktime()方法
    linux中怎样从底部向上查看log文件
    python基础之使用os.system来执行系统命令
    python datetime处理时间
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2277074.html
Copyright © 2020-2023  润新知