コード例 #1
0
        public void GetAll_Test()
        {
            ICollection <Spending> spendings = new HashSet <Spending>();

            spendings = spendingRepo.GetAll();

            Assert.IsNotNull(spendings);
            Assert.AreEqual(spendings.Count, spendingRepo.GetAll().Count);
        }
コード例 #2
0
        public async Task <ActionResult <IEnumerable <Spending> > > GetSpendings()
        {
            var user = await _repository.ValidUser(GetTokenUserId());

            if (user == null)
            {
                return(NotFound());
            }

            var spendings = await _repository.GetAll(user.Id);

            if (spendings == null)
            {
                return(NotFound());
            }

            return(Ok(spendings));
        }
コード例 #3
0
 // GET: Spending
 public async Task <IActionResult> Index()
 {
     return(View(await _repository.GetAll()));
 }
コード例 #4
0
 public IQueryable <Spending> GetAll()
 {
     return(_repositorySpending.GetAll());
 }