67 lines
1.3 KiB
C#
67 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity;
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
namespace ChatRoomServer.Db.Entities
|
|
{
|
|
/// <summary>
|
|
///
|
|
///</summary>
|
|
public class Room
|
|
{
|
|
/// <summary>
|
|
/// 房间ID
|
|
/// </summary>
|
|
public string ID { get; set; }
|
|
|
|
/// <summary>
|
|
/// 大区名称
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 分类
|
|
/// </summary>
|
|
public int Category { get; set; }
|
|
|
|
/// <summary>
|
|
/// 服务器分组
|
|
/// </summary>
|
|
public int ServerGroup { get; set; }
|
|
|
|
/// <summary>
|
|
/// 推荐状态
|
|
/// </summary>
|
|
public bool Recommand { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否可用
|
|
/// </summary>
|
|
public bool Status { get; set; }
|
|
|
|
/// <summary>
|
|
/// 在线数
|
|
/// </summary>
|
|
public int OnlineCount { get; set; }
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 实体类 <see cref="Room" /> 的配置对象
|
|
/// </summary>
|
|
internal class RoomConfiguration : EntityTypeConfiguration<Room>
|
|
{
|
|
public RoomConfiguration()
|
|
{
|
|
ToTable("Chat_Room");
|
|
HasKey(m => m.ID);
|
|
Property(s => s.ID).HasMaxLength(50).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
|
|
Property(s => s.Name).HasMaxLength(200).IsRequired();
|
|
}
|
|
}
|
|
}
|