﻿//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由Codesmith工具生成。
// 此文件的更改可能会导致不正确的行为，如果
// 重新生成代码，这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using ProtoBuf;
using ZyGames.Framework.Common;
using ZyGames.Framework.Collection;
using ZyGames.Framework.Model;


namespace ZyGames.Doudizhu.Model
{
    /// <summary>
    /// 聊天语言配置
    /// </summary>
    /// <![CDATA[
    /// @periodTime:设置生存周期(秒)
    /// @personalName: 映射UserId对应的字段名,默认为"UserId"
    /// ]]>
    /// </remarks>
    [Serializable, ProtoContract]
    [EntityTable(AccessLevel.ReadOnly, DbConfig.Config, "ChatInfo")]
    public class ChatInfo : ShareEntity
    {

        /// <summary>
        /// </summary>
        public ChatInfo()
            : base(AccessLevel.ReadOnly)
        {
            
        }        
        /// <summary>
        /// </summary>
        public ChatInfo(int id)
            : this()
        {
            _id = id;
        }

        #region 自动生成属性
        private int _id;
        /// <summary>
        /// 
        /// </summary>        
        [ProtoMember(1)]
        [EntityField("Id", IsKey = true)]
        public int Id
        {
            get
            {
                return _id;
            } 
            
        }
        private string _content;
        /// <summary>
        /// 
        /// </summary>        
        [ProtoMember(2)]
        [EntityField("Content")]
        public string Content
        {
            get
            {
                return _content;
            } 
            
        }
    
        protected override object this[string index]
		{
			get
			{
                #region
				switch (index)
				{
                    case "Id": return _id;
                    case "Content": return _content;
					default: throw new ArgumentException(string.Format("ChatInfo index[{0}] isn't exist.", index));
				}
                #endregion
			}
			set
			{
                #region
				switch (index)
				{
                    case "Id": 
                        _id = value.ToInt();
                        break; 
                    case "Content": 
                        _content = value.ToNotNullString();
                        break; 
					default: throw new ArgumentException(string.Format("ChatInfo index[{0}] isn't exist.", index));
				}
                #endregion
			}
		}
        
        #endregion
        

	}
}