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);
        }
Exemple #2
0
 public override string Differentiate()
 {
     return("(" + ChildOne.Differentiate() + ")(" + strChildTwo + ")+(" + strChildOne + ")(" + ChildTwo.Differentiate() + ")");
 }
 public virtual void AddSelectedColumns(ChildOne parent)
 {
     parent.MyParent = this;
     ChildList.Add(parent);
 }
Exemple #4
0
 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();
     }
 }