public TransactionList GetDebitsByType(DebitTypeEnum debitType)
        {
            var data = DataStore.LoadData();

            var query = from trans in data
                        let debit = trans as Debit
                                    where debit != null && debit.DebitType == debitType
                                    orderby debit.Date, debit.Amount, debit.Description
            select debit;

            return(new TransactionList(query));
        }
Ejemplo n.º 2
0
        // GET: api/GetDebitsByType
        public TransactionList GetDebitsByType(DebitTypeEnum debitType)
        {
            var data = TransactionList.Load(FilePath).AsQueryable();

            return(new TransactionList(data.Where(t => (t is Debit) && (t as Debit).DebitType == debitType).ToList())); // return only transcations where credit type is included in credit type enum, sort as above
        }