コード例 #1
0
        public static void Do()
        {
            GrandParent rpt = new GrandParent {
                Name = "report1", Description = "This is simply a report"
            };

            ParentOne stcln1 = new ParentOne {
                Columns = "asdf", Alias = "just a column"
            };
            ParentOne stcln2 = new ParentOne {
                Columns = "asdf", Alias = "just a column"
            };

            rpt.ParentList = new List <ParentOne>();
            rpt.AddSelectedColumns(stcln1);
            rpt.AddSelectedColumns(stcln2);

            ChildOne c1 = new ChildOne();

            c1.Name = "Ram";

            stcln1.AddSelectedColumns(c1);
            Helper.Create(rpt);

            Helper.Select();

            //f.Create<Report>(rpt);


            ///Delete many elements in one-to-may relationship

            //var obj1 = f.GetSelectedColumnsById(1);
            //Collection<SelectedColumn> selectedcolumns = new Collection<SelectedColumn>();

            //foreach(object[] item in obj1)
            //{
            //    selectedcolumns.Add(new SelectedColumn {ParentId=(int) item[0],Columns = (string) item[1], Alias = (string) item[2], SortType = (string) item[3], SortOrder = (string) item[4], GrandParentId = (int) item[5]   });
            //}

            //f.Delete<SelectedColumn>(selectedcolumns);
        }
コード例 #2
0
 public override string Differentiate()
 {
     return("(" + ChildOne.Differentiate() + ")(" + strChildTwo + ")+(" + strChildOne + ")(" + ChildTwo.Differentiate() + ")");
 }
コード例 #3
0
 public virtual void AddSelectedColumns(ChildOne parent)
 {
     parent.MyParent = this;
     ChildList.Add(parent);
 }
コード例 #4
0
ファイル: EntityRelationTest.cs プロジェクト: Allen-Zhou/AF
 public void EntityInheritInsertTest()
 {
     using (var repo = RepositoryContext.GetRepository())
     {
         var childOne = new ChildOne()
         {
             ID = Guid.Parse("B2DD9317-7A40-4D44-A5C6-26DCA237E093"),
             FirstName = "clildOneFN_0927",
             LastName = "clildOneLN_0927",
             Email = "*****@*****.**"
         };
         var childTwo = new ChildTwo()
         {
             ID = Guid.Parse("B2DD9317-7A40-4D44-A5C6-26DCA237E091"),
             FirstName = "clildOneFN_0927",
             LastName = "clildOneLN_0927",
             Number = "13305310001"
         };
         repo.Add(childOne);
         repo.Add(childTwo);
         repo.SaveChanges();
     }
 }