|
|
@ -223,36 +223,36 @@ namespace Tiobon.Core.Common.Seed |
|
|
|
|
|
|
|
|
|
|
|
#region Topic |
|
|
|
#region Topic |
|
|
|
|
|
|
|
|
|
|
|
if (!await myContext.Db.Queryable<Topic>().AnyAsync()) |
|
|
|
//if (!await myContext.Db.Queryable<Topic>().AnyAsync()) |
|
|
|
{ |
|
|
|
//{ |
|
|
|
var data = JsonConvert.DeserializeObject<List<Topic>>( |
|
|
|
// var data = JsonConvert.DeserializeObject<List<Topic>>( |
|
|
|
FileHelper.ReadFile(string.Format(SeedDataFolder, "Topic"), Encoding.UTF8), setting); |
|
|
|
// FileHelper.ReadFile(string.Format(SeedDataFolder, "Topic"), Encoding.UTF8), setting); |
|
|
|
|
|
|
|
|
|
|
|
myContext.GetEntityDB<Topic>().InsertRange(data); |
|
|
|
// myContext.GetEntityDB<Topic>().InsertRange(data); |
|
|
|
Console.WriteLine("Table:Topic created success!"); |
|
|
|
// Console.WriteLine("Table:Topic created success!"); |
|
|
|
} |
|
|
|
//} |
|
|
|
else |
|
|
|
//else |
|
|
|
{ |
|
|
|
//{ |
|
|
|
Console.WriteLine("Table:Topic already exists..."); |
|
|
|
// Console.WriteLine("Table:Topic already exists..."); |
|
|
|
} |
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region TopicDetail |
|
|
|
#region TopicDetail |
|
|
|
|
|
|
|
|
|
|
|
if (!await myContext.Db.Queryable<TopicDetail>().AnyAsync()) |
|
|
|
//if (!await myContext.Db.Queryable<TopicDetail>().AnyAsync()) |
|
|
|
{ |
|
|
|
//{ |
|
|
|
var data = JsonConvert.DeserializeObject<List<TopicDetail>>( |
|
|
|
// var data = JsonConvert.DeserializeObject<List<TopicDetail>>( |
|
|
|
FileHelper.ReadFile(string.Format(SeedDataFolder, "TopicDetail"), Encoding.UTF8), setting); |
|
|
|
// FileHelper.ReadFile(string.Format(SeedDataFolder, "TopicDetail"), Encoding.UTF8), setting); |
|
|
|
|
|
|
|
|
|
|
|
myContext.GetEntityDB<TopicDetail>().InsertRange(data); |
|
|
|
// myContext.GetEntityDB<TopicDetail>().InsertRange(data); |
|
|
|
Console.WriteLine("Table:TopicDetail created success!"); |
|
|
|
// Console.WriteLine("Table:TopicDetail created success!"); |
|
|
|
} |
|
|
|
//} |
|
|
|
else |
|
|
|
//else |
|
|
|
{ |
|
|
|
//{ |
|
|
|
Console.WriteLine("Table:TopicDetail already exists..."); |
|
|
|
// Console.WriteLine("Table:TopicDetail already exists..."); |
|
|
|
} |
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|