You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Chloe.Annotations;
|
|
|
|
|
using Chloe.Entity;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
public abstract class SystemEntityTypeBuilder<T> : EntityTypeBuilder<T> where T : BaseChimsDb
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected SystemEntityTypeBuilder(string tableName)
|
|
|
|
|
{
|
|
|
|
|
this.MapTo(tableName);
|
|
|
|
|
this.Property(a => a.ID).IsAutoIncrement(false).IsPrimaryKey();
|
|
|
|
|
this.UpdateIgnore(x => x.CreateUserId);
|
|
|
|
|
this.Property(x => x.CreateUserId).HasSize(19);
|
|
|
|
|
this.Property(x => x.LastModifyUserId).HasSize(19);
|
|
|
|
|
this.Property(x => x.CreateUserName).HasSize(10);
|
|
|
|
|
this.Property(x => x.LastModifyUserName).HasSize(10);
|
|
|
|
|
this.Property(x => x.IsEnable).HasSize(1);
|
|
|
|
|
this.Property(x => x.IsDelete).HasSize(1);
|
|
|
|
|
this.UpdateIgnore(x => x.CreateDate);
|
|
|
|
|
this.UpdateIgnore(x => x.CreateUserName);
|
|
|
|
|
HasQueryFilter(x => x.IsDelete == 0 && x.IsEnable == 1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BaseChimsDb
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[Column(IsPrimaryKey = true)]
|
|
|
|
|
[NonAutoIncrement]
|
|
|
|
|
public long ID { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public short IsEnable { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public short IsDelete { get; set; } = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UpdateIgnore]
|
|
|
|
|
public DateTime CreateDate { get; set; } = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UpdateIgnore]
|
|
|
|
|
|
|
|
|
|
public string CreateUserId { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UpdateIgnore]
|
|
|
|
|
|
|
|
|
|
public string CreateUserName { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DateTime LastModifyDate { get; set; } = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string LastModifyUserId { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string LastModifyUserName { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|