// ------------ Actions ------------- // #region public Actions // GET: Owner (all appointments by owner) public ActionResult Index() { Guid ownerID = GetIDByUserId(); List <Guid> myPets = petRepository.GetByOwner(ownerID).Select(x => x.PetID).ToList(); List <Appointment> myAppointments = appointmentRepository.GetAppointmentsByPetList(myPets); return(View("Appointments", myAppointments)); }
public ActionResult Index() { string userId = User.Identity.GetUserId(); ownerID = ownerRepository.GetIdByUserId(userId); var pets = repository.GetByOwner(ownerID); return(View("Index", pets)); }