zoukankan      html  css  js  c++  java
  • 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;

                }

            }

     

  • 相关阅读:
    访问修饰符
    SqlServer 查运行进程
    SqlServer 作业计时执行存储过程,杀超时进程
    VS快捷键操作
    sql server 命令
    vs 加载 dev控件
    TreeList显示[+] [-] 线条样式
    佳能MG2580S清零
    Dev WaitDialog 使用
    导出.txt / .pdf / .xls
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2277074.html
Copyright © 2011-2022 走看看