private void LoadPositionType(Committee committee) { if (Entity.IsNull(committee.Type)) { throw new BadRequestException("AddressType can not be null"); } committee.Type = repository.Load<PositionType>(committee.Type.Id); }
public void SetUp() { testDataHelper = new TestDataHelper(); committeeRepository = new CommitteeRepository(testDataHelper.session); var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin()); savedConstituent = testDataHelper.CreateConstituent(constituent); savedCommittee = testDataHelper.CreateCommittee(CommitteeMother.President(savedConstituent)); }
public Committee Update(Committee committee) { using (var txn = session.BeginTransaction()) { var savedCommittee = SaveOrUpdate(committee, txn); txn.Commit(); return savedCommittee; } }
public Committee UpdateCommittee(Committee committee) { LoadPositionType(committee); return repository.Update(committee); }
public Committee CreateCommittee(Committee committee) { LoadPositionType(committee); return repository.Save(committee); }