/// <summary> /// This reads all the orchestras available in the database using a View Model and with a select /// giving the properties designated. this makes a list of the Orchestra in the view. /// </summary> /// <returns>model</returns> public IActionResult Index() { var model = _repo.ReadAllOrchestras() .Select(o => new OrchestraListVM { Id = o.Id, Name = o.Name, AddressLine1 = o.AddressLine1, AddressLine2 = o.AddressLine2, City = o.City, State = o.State, ZipCode = o.ZipCode, WebsiteUrl = o.WebsiteUrl, NumMusician = o.Musician.Count() }); return(View(model)); }
/// <summary> /// This reades all the Orchestras /// </summary> /// <returns>model</returns> public IActionResult Index() { var model = _repo.ReadAllOrchestras(); return(View(model)); }