using AX.FireTrainingSys.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AX.FireTrainingSys.EntityConfigurations { public class UserConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.Property(e => e.Id) .IsUnicode(false) .HasValueGenerator(); entity.Property(e => e.Name) .IsUnicode(false); entity.Property(e => e.Password) .IsUnicode(false); entity.Property(e => e.CreationTime) .HasConversion(ConverterHelper.DateTimeToStringConverter()); entity.HasIndex(e => e.Id); entity.HasIndex(e => e.Name).IsUnique(); entity.HasIndex(e => e.RealName); entity.HasIndex(e => e.CreationTime); entity.HasQueryFilter(e => !e.Deleted); } } }