public Payee AddPayee(Guid userId, Payee payee) { Payee res = null; var detail = _UserCollection.GetById(userId); if (detail != null) { var linkingBank = _LinkingBankCollection.GetById(payee.LinkingBankId); if (linkingBank != null) { // get payee detail var payeeDetail = _UserCollection.GetByAccountNumber(payee.AccountNumber); if (payeeDetail != null) { if (string.IsNullOrEmpty(payee.MnemonicName)) { payee.MnemonicName = payeeDetail.Name; } payee.Id = Guid.NewGuid(); var countModified = _UserCollection.AddPayee(userId, payee); if (countModified > 0) { res = payee; } } } } return(res); }