45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using WebDoorCreator.Data.DbModels;
|
|
|
|
namespace WebDoorCreator.Data
|
|
{
|
|
public class ListValuesConfiguration : IEntityTypeConfiguration<ListValuesModel>
|
|
{
|
|
#region Public Methods
|
|
|
|
public void Configure(EntityTypeBuilder<ListValuesModel> builder)
|
|
{
|
|
|
|
// Default seeded users
|
|
builder.HasData(
|
|
seedListValues("Opening", "Swing", "LH", "Left Handed", 1),
|
|
seedListValues("Opening", "Swing", "RH", "Right Handed", 2),
|
|
seedListValues("Opening", "Swing", "LHR", "Left Handed Reverse", 3),
|
|
seedListValues("Opening", "Swing", "RHR", "Right Handed Reverse", 4)
|
|
);
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected ListValuesModel seedListValues(string tableName, string fieldName, string value, string label, int ordinal)
|
|
{
|
|
var newRec = new ListValuesModel()
|
|
{
|
|
TableName = "Opening",
|
|
FieldName = "Swing",
|
|
value = value,
|
|
label = label,
|
|
ordinal = ordinal
|
|
};
|
|
|
|
|
|
return newRec;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |