36 lines
938 B
C#
36 lines
938 B
C#
using Gpulse.WCT.DataAnalyzer.Core.Domain.Local;
|
|
|
|
namespace Gpulse.WCT.DataAnalyzer.Core.Infrastructure.LocalData;
|
|
|
|
/// <summary>
|
|
/// 初始数据种子
|
|
/// </summary>
|
|
public static class SeedData
|
|
{
|
|
/// <summary>
|
|
/// TX面板类型预设数据
|
|
/// </summary>
|
|
public static readonly TxPanel[] DefaultTxPanels =
|
|
[
|
|
new() { Name = "none" },
|
|
new() { Name = "single-mold" },
|
|
new() { Name = "single-rapid" },
|
|
new() { Name = "single-3d" },
|
|
new() { Name = "dual-mold" },
|
|
new() { Name = "dual-rapid" },
|
|
new() { Name = "dual-3d" }
|
|
];
|
|
|
|
/// <summary>
|
|
/// 初始化种子数据
|
|
/// </summary>
|
|
public static void Initialize(WctMinerDbContext context)
|
|
{
|
|
// 确保 TxPanel 表有预设数据
|
|
if (!context.TxPanels.Any())
|
|
{
|
|
context.TxPanels.AddRange(DefaultTxPanels);
|
|
context.SaveChanges();
|
|
}
|
|
}
|
|
} |