You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
823 B
31 lines
823 B
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Wood.Entity.SystemManage;
|
|
using Wood.Util;
|
|
|
|
namespace Wood.Data.Repository.DataSeed
|
|
{
|
|
public class UserDataSeed
|
|
{
|
|
public static void InitData(ISqlSugarClient db)
|
|
{
|
|
string dataSeedPath = Path.Combine(GlobalContext.HostingEnvironment!.ContentRootPath, "DataSeed.sql");
|
|
|
|
if (File.Exists(dataSeedPath))
|
|
{
|
|
var lines = File.ReadAllLines(dataSeedPath);
|
|
foreach (var item in lines)
|
|
{
|
|
if (item.StartsWith("INSERT"))
|
|
{
|
|
db.Ado.ExecuteCommand(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|