public IContactBus GetContact(object contactId) { var result = new ContactBus(); var contact = _repo.SingleOrDefault<Contact>(contactId); if (contact != null) { result.ContactData = contact; } return result; }
private void AddContact() { // First "initialize" the new ContactBus-Object and then // assign it to CurrentContact like so: CurrentContact = new ContactBus { ContactData = new Contact { ObjectStatus=DataObjectStatus.Added } , AddressData = new Address { ObjectStatus=DataObjectStatus.Added } }; }