48 lines
1.6 KiB
C#
48 lines
1.6 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),
|
|
seedListValues("Edges", "EdgeType", "BV", "Bevel", 1),
|
|
seedListValues("Edges", "EdgeType", "SQ", "Squared", 2),
|
|
seedListValues("Edges", "EdgeType", "1B", "Bull Nose 1", 3)
|
|
);
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected ListValuesModel seedListValues(string tableName, string fieldName, string value, string label, int ordinal)
|
|
{
|
|
var newRec = new ListValuesModel()
|
|
{
|
|
TableName = tableName,
|
|
FieldName = fieldName,
|
|
Value = value,
|
|
Label = label,
|
|
Ordinal = ordinal
|
|
};
|
|
|
|
|
|
return newRec;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |