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 DisasterConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.Property(e => e.Id) .IsUnicode(false) .IsFixedLength() .HasValueGenerator(); entity.Property(e => e.CreationTime) .HasConversion(ConverterHelper.DateTimeToStringConverter()); entity.HasIndex(e => e.CreationTime); entity.HasIndex(e => e.Name); entity.HasIndex(e => e.CompanyName); entity.HasIndex(e => e.State); entity.HasQueryFilter(e => !e.Deleted); } } }