using Admin.NET.Core; using @Model.EntityNameSpace; namespace @Model.NameSpace; /// /// @(Model.Description) 表种子数据 /// public class @(Model.SeedDataName): ISqlSugarEntitySeedData<@(Model.EntityName)> { /// /// 种子数据 /// /// public IEnumerable<@(Model.EntityName)> HasData() { string recordsJSON = @@" @(Model.RecordsJSON.Replace("\"","\"\"").Replace("\n", "\n\t\t\t")) "; List<@(Model.EntityName)> records = Newtonsoft.Json.JsonConvert.DeserializeObject>(recordsJSON); @if (Model.JsonIgnoreInfo.Count>0) { @: @:#region 处理 JsonIgnore 的Property @: @foreach (var jii in Model.JsonIgnoreInfo){ @foreach (var j in jii){ @:records[@j.RecordIndex].@(j.Name) = @(j.Value); } @: } @:#endregion } // 后处理数据的特殊字段 //for (int i = 0; i < records.Count; i++) { } return records; } }