コード例 #1
0
ファイル: Updater.cs プロジェクト: xwagner2/eXpand
 public override void UpdateDatabaseAfterUpdateSchema()
 {
     base.UpdateDatabaseAfterUpdateSchema();
     if (ObjectSpace.Session.FindObject <TCACategory>(null) == null)
     {
         var category = new TCACategory(ObjectSpace.Session)
         {
             Name = "1", FullName = "Group 1"
         };
         new TCACategory(ObjectSpace.Session)
         {
             Name = "1.1", Parent = category, FullName = "Text 1.1", MoreInfo = "moreinfo 1.1", MoreInfo2 = "moreinfo2 1.1"
         };
         new TCACategory(ObjectSpace.Session)
         {
             Name = "1.2", Parent = category, FullName = "Text 1.2", MoreInfo = "moreinfo 1.2", MoreInfo2 = "moreinfo 1.2"
         };
         category = new TCACategory(ObjectSpace.Session)
         {
             Name = "2", FullName = "Group 2"
         };
         new TCACategory(ObjectSpace.Session)
         {
             Name = "2.1", Parent = category
         };
         new TCACategory(ObjectSpace.Session)
         {
             Name = "2.2", Parent = category
         };
         ObjectSpace.CommitChanges();
     }
 }
コード例 #2
0
ファイル: Updater.cs プロジェクト: aries544/eXpand
 public override void UpdateDatabaseAfterUpdateSchema() {
     base.UpdateDatabaseAfterUpdateSchema();
     if (ObjectSpace.Session.FindObject<TCACategory>(null) == null) {
         var category = new TCACategory(ObjectSpace.Session) { Name = "1", FullName = "Group 1" };
         new TCACategory(ObjectSpace.Session) { Name = "1.1", Parent = category, FullName = "Text 1.1", MoreInfo = "moreinfo 1.1", MoreInfo2 = "moreinfo2 1.1" };
         new TCACategory(ObjectSpace.Session) { Name = "1.2", Parent = category, FullName = "Text 1.2", MoreInfo = "moreinfo 1.2", MoreInfo2 = "moreinfo 1.2" };
         category = new TCACategory(ObjectSpace.Session) { Name = "2", FullName = "Group 2" };
         new TCACategory(ObjectSpace.Session) { Name = "2.1", Parent = category };
         new TCACategory(ObjectSpace.Session) { Name = "2.2", Parent = category };
         ObjectSpace.CommitChanges();
     }
 }