public IAccountBus GetAccount(object accountId) { var result = new AccountBus(); var account = _repo.SingleOrDefault<Account>(accountId); if (account != null) { result.AccountData = account; } return result; }
private void AddAccount() { // First "initialize" the new AccountBus-Object and then // assign it to CurrentVendor like so: CurrentVendor = new AccountBus { AccountData = new Account { ObjectStatus=DataObjectStatus.Added , AccountName = "New Vendor" , Type = Names.DataNavTypeVendor } , AddressData = new Address { ObjectStatus=DataObjectStatus.Added } }; }