DD.WellWorkover.Cloud/AsbCloudDb/Model/DefaultData/EntityFiller.cs

18 lines
440 B
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.DefaultData
{
internal abstract class EntityFiller<TEntity> : IEntityFiller
where TEntity : class
{
protected abstract TEntity[] GetData();
public void FillData(ModelBuilder modelBuilder)
{
modelBuilder.Entity<TEntity>(entity =>
{
entity.HasData(GetData());
});
}
}
}