Exemplo n.º 1
0
        /// <summary>
        /// 转换成AsEditModel
        /// </summary>
        public static SensitiveWordTypeEditModel AsEditModel(this SensitiveWordType sensitiveWord)
        {
            return(new SensitiveWordTypeEditModel
            {
                Name = sensitiveWord.Name,

                TypeId = sensitiveWord.TypeId
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// 转化为SensitiveWordType用于数据库存储
        /// </summary>
        /// <returns>SensitiveWord</returns>
        public SensitiveWordType AsSensitiveWordType()
        {
            SensitiveWordType sensitiveWordType = null;

            if (this.TypeId > 0)
            {
                sensitiveWordType = new SensitiveWordService().GetSensitiveWordType(this.TypeId.Value);
            }
            else
            {
                sensitiveWordType = SensitiveWordType.New();
            }

            sensitiveWordType.Name = this.Name;

            return(sensitiveWordType);
        }