public async Task <ActionResult <Result <IEnumerable <Transaction> > > > GetTransactionsByUserId(string userId) { Result <IEnumerable <Transaction> > resultTransactions = await _usersTransactionRepository.GetTransactionsByUserId(userId); if (resultTransactions.Entity == null || resultTransactions.Entity.Count() == 0) { resultTransactions.IsSuccess = false; resultTransactions.AddError("Transaction not found for the provided id."); return(NotFound(resultTransactions)); } resultTransactions.IsSuccess = true; return(resultTransactions); }
public async Task <IEnumerable <Transaction> > GetTransactionsByUserId(int userid) { return(await _usersTransactionRepository.GetTransactionsByUserId(userid)); }