コード例 #1
0
 public ExpenseDTO GetExpenseById(string currentUser, int id)
 {
     return((from e in _expRepo.Get(currentUser, id)
             // where e.Id == id, where clauses only belong in the Repository
             select new ExpenseDTO()
     {
         Id = e.Id,
         ApptDate = e.ApptDate,
         CategoryType = e.Category.CatType,
         Cost = e.Cost,
         Description = e.Description,
         Physician = e.Physician
     }).FirstOrDefault());
 }
コード例 #2
0
 public IEnumerable <ListExpenseViewModel> Get()
 {
     return(_repository.Get());
 }