Esempio n. 1
0
 public void TestAddOneSide()
 {
     var r3 = new EmpRole() {Name = "Delete"};
     u1.Roles.Add(r3);
     Session.SaveOrUpdate(u1);
     Session.Flush();
 }
Esempio n. 2
0
 public void InitData()
 {
     ReBuildDatabase();
     u1=new EmpUser(){Name = "User1"};
     u2 = new EmpUser() { Name = "User2" };
     r1=new EmpRole(){Name = "Select"};
     r2 = new EmpRole() { Name = "Edit" };
     u1.Roles=new List<EmpRole>(){r1,r2};
     u2.Roles=new List<EmpRole>(){r1};
     Session.Save(u1);
     Session.Save(u2);
     Session.Save(r1);
     Session.Save(r2);
     Session.Flush();
 }