public bool UpdateAccountUser(AccountUser accountUser) { if (accountUser.AddressId== 0) { //save the address and get the addressId var dataAddress = Mapper.Map<DataAddress>(accountUser.Address); accountUser.AddressId = _addressRepository.SaveAddress(dataAddress); } var dataAccountUser = Mapper.Map<DataAccountUser>(accountUser); return _accountUserRepository.UpdateAccountUser(dataAccountUser); }
public AccountUser RegisterAccountUser(AccountUser accountUser) { var dataAccountUser = Mapper.Map<DataAccountUser>(accountUser); dataAccountUser = _accountUserRepository.RegisterAccountUser(dataAccountUser); return Mapper.Map<AccountUser>(dataAccountUser); }