29 lines
899 B
C#
29 lines
899 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using MP.FileData.DatabaseModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.FileData
|
|
{
|
|
public static class ModelBuilderExtensions
|
|
{
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Estensione per seed iniziale dei dati nel DB
|
|
/// </summary>
|
|
/// <param name="modelBuilder"></param>
|
|
public static void Seed(this ModelBuilder modelBuilder)
|
|
{
|
|
// inizializzazione dei valori di default x MACCHINA
|
|
modelBuilder.Entity<MacchinaModel>().HasData(
|
|
new MacchinaModel { IdxMacchina = "0", RuleName = "0", Descrizione = "--- Tutte ---", Nome = "--- Tutte ---", BasePath = "", ImgUrl = "", Note = "", ShowOrder = 0 }
|
|
);
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |