using System.Collections.Generic;
using BlueWest.Data;
using BlueWest.WebApi.EF.Model;
using Microsoft.EntityFrameworkCore;
namespace BlueWest.WebApi.Extensions
{
public static class ModelBuilderMigrationExtensions
{
///
/// Setup the database model
///
///
public static void AddCurrencyAndCountryData(this ModelBuilder modelBuilder)
{
var countriesToAdd = new List();
var country = new Country();
country.Id = 1;
country.Code = 1;
country.Name = "United States";
country.Alpha2Code = "US";
country.StateName = "United States of America";
countriesToAdd.Add(country);
modelBuilder
.Entity()
.HasData(countriesToAdd.ToArray());
}
}
}