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;

                }

            }

     

  • 相关阅读:
    个人号微信机器人开发
    群控系统开发sdk服务端调用方法
    微信个人号scrm客服通信协议定义
    微信crm客服系统使用sdk定制开发(持续更新中!)
    微信客服crm系统接口定义(完善中)
    压测工具-ab
    设计模式之美学习-结构型-享元模式(二十五)
    设计模式之美学习-结构型-组合模式(二十四)
    设计模式之美学习-结构型-门面模式(二十三)
    设计模式之美学习-结构型-适配器模式(二十二)
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2277074.html
Copyright © 2011-2022 走看看