public AccountDbRepoModel GetAccountById(int id) { var accountEnity = new AccountDbRepoModel(); using (_unitOfWork.Add <AccountDbRepoModel>()) { accountEnity = _unitOfWork.GetRepository <AccountDbRepoModel>().Get(acc => acc.Id == id, null, "Status,CurrencyRelation").FirstOrDefault(); } return(accountEnity); }
public int CreateAccount(AccountModel account) { var accountEntity = new AccountDbRepoModel(); using (_unitOfWork.Add <AccountDbRepoModel>()) { accountEntity = _mapper.Map <AccountDbRepoModel>(account); _unitOfWork.GetRepository <AccountDbRepoModel>().AddItem(accountEntity); _unitOfWork.Save(); } return(accountEntity.Id); }