public void Add(Business business) { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Save(business); transaction.Commit(); } }
public void CreateBusiness() { IService service = new Service(); Business b = new Business(); b.Id = 1; b.Name = "SKY"; b.Employees = new List<Person>(); Person p = new Person(); p.Id = 1; p.Name = "Sepehr"; b.Employees.Add(p); service.Add(b); Business sky = service.GetById(1); Assert.IsNotNull(sky); }
public void Update(Business business) { throw new NotImplementedException(); }