public IActionResult Index() { var homeVM = new HomeViewModel() { BandCount = _bandRepository.Count(x => true), CustomerCount = _customerRepository.Count(x => true), AlbumCount = _albumRepository.Count(x => true), LendAlbumCount = _albumRepository.Count(x => x.Borrower != null) }; return(View(homeVM)); }
public IActionResult List() { var customerVM = new List <CustomerViewModel>(); var customers = _customerRepository.GetAll(); if (customers.Count() == 0) { return(View("Empty")); } foreach (var customer in customers) { customerVM.Add(new CustomerViewModel { Customer = customer, AlbumCount = _albumRepository.Count(x => x.BorrowerId == customer.CustomerId) }); } return(View(customerVM)); }
public int Count() { return(AlbumRepository.Count()); }
public void GetCountAlbum() { var cantidad = albumRepository.Count(); Assert.IsTrue(cantidad > 0, "OK"); }