You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
975 B
32 lines
975 B
2 years ago
|
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<Disaster>
|
||
|
{
|
||
|
public void Configure(EntityTypeBuilder<Disaster> entity)
|
||
|
{
|
||
|
entity.Property(e => e.Id)
|
||
|
.IsUnicode(false)
|
||
|
.IsFixedLength()
|
||
|
.HasValueGenerator<ObjectIdGenerator>();
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|