65 lines
1.4 KiB
C#
65 lines
1.4 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 MsgLog
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// ID
|
|||
|
/// </summary>
|
|||
|
public long Id { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 用户名
|
|||
|
/// </summary>
|
|||
|
public string UserName { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 发送时间
|
|||
|
/// </summary>
|
|||
|
public DateTime SendTime { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 发送内容
|
|||
|
/// </summary>
|
|||
|
public string Content { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// IP
|
|||
|
/// </summary>
|
|||
|
public string Ip { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// RoomID
|
|||
|
/// </summary>
|
|||
|
public string RoomId { get; set; }
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 实体类 <see cref="MsgLog" /> 的配置对象
|
|||
|
/// </summary>
|
|||
|
internal class MsgLogConfiguration : EntityTypeConfiguration<MsgLog>
|
|||
|
{
|
|||
|
public MsgLogConfiguration()
|
|||
|
{
|
|||
|
ToTable("Chat_MsgLog");
|
|||
|
HasKey(m => m.Id);
|
|||
|
Property(s => s.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
|
|||
|
Property(s => s.UserName).HasMaxLength(100).IsRequired();
|
|||
|
Property(s => s.Content).HasMaxLength(800).IsRequired();
|
|||
|
Property(s => s.Ip).HasMaxLength(100).IsRequired();
|
|||
|
Property(s => s.RoomId).HasMaxLength(100).IsRequired();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|