public IEnumerable <Expenditure> GetProjectExpenditures(string projectId) { return(Expenditures.Where(q => q.ProjectId == projectId).OrderBy(q => q.CreateTime).ToArray()); }
public IEnumerable <Expenditure> GetProjectExpenditures(string projectId, BudgetCategory category) { return(Expenditures.Where(q => q.ProjectId == projectId && q.BudgetCategory == (int)category).OrderBy(q => q.CreateTime).ToArray()); }
private double GetExpendituresTotalCount(string projectId, int budgetCategory) { double?result = Expenditures.Where(q => q.ProjectId == projectId && q.BudgetCategory == budgetCategory).Select(q => (double?)q.Count).Sum(); return(result ?? 0.0); }