54 lines
1.1 KiB
C#
54 lines
1.1 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 ServerGroup
|
|
{
|
|
/// <summary>
|
|
/// 分组ID
|
|
/// </summary>
|
|
public int ID { get; set; }
|
|
|
|
/// <summary>
|
|
/// 名称
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 服务器地址
|
|
/// </summary>
|
|
public string Url { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 分组ID
|
|
/// </summary>
|
|
public int Category { get; set; }
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 实体类 <see cref="ServerGroup" /> 的配置对象
|
|
/// </summary>
|
|
internal class ServerGroupConfiguration : EntityTypeConfiguration<ServerGroup>
|
|
{
|
|
public ServerGroupConfiguration()
|
|
{
|
|
ToTable("Chat_ServerGroup");
|
|
HasKey(m => m.ID);
|
|
Property(s => s.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
|
|
Property(s => s.Name).HasMaxLength(100).IsRequired();
|
|
Property(s => s.Url).HasMaxLength(255).IsRequired();
|
|
}
|
|
}
|
|
}
|