forked from ddrilling/AsbCloudServer
19 lines
469 B
C#
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());
|
|
});
|
|
}
|
|
}
|
|
} |