DD.WellWorkover.Cloud/AsbCloudDb/Model/DefaultData/EntityFiller.cs
2022-11-25 09:34:20 +05:00

19 lines
469 B
C#

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