// Write a query to return the transaction list for the selected user (userId) // ordered descending by Transaction.Date, then ordered ascending by Asset.Name // and then ordered ascending by Category.Name. // Each record of the output model should include Asset.Name, Category.Name // (transaction subcategory), Category.ParentName (transaction parent category), // Transaction.Amount, Transaction.Date and Transaction.Comment. public List <TransactionWithParentCategoryDto> GetUsersTransactions(Guid userId) { var transactions = MoneyManagerContext.Transactions .Where(t => t.Asset.UserId == userId) .OrderByDescending(t => t.Date) .ThenBy(t => t.Asset.Name) .ThenBy(t => t.Category.Name); return(TransactionMapper.MapToTransactionWithParentCategoryDto(transactions).ToList()); }
public new TransactionWithParentCategoryDto Get(Guid transactionId) { var transaction = base.Get(transactionId); return(TransactionMapper.MapToTransactionWithParentCategoryDto(transaction)); }