2015-07-03 21:04:37 +08:00
|
|
|
|
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; }
|
|
|
|
|
|
2015-07-08 17:24:45 +08:00
|
|
|
|
public string Image { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Color { get; set; }
|
|
|
|
|
|
|
|
|
|
public string AtUser { get; set; }
|
|
|
|
|
|
2015-07-03 21:04:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|