コード例 #1
0
        //To show specific guest deatils with selected id.
        /// <summary>Guestshows the specified identifier.</summary>
        /// <param name="id">The identifier.</param>
        /// <returns>Signle user detials</returns>
        public ActionResult Guestshow(int id)
        {
            GuestListContext guestListContext = new GuestListContext();
            ListOfGuest      guest            = guestListContext.ListOfGuest.Single(x => x.GuestId == id);

            return(View(guest));
        }
コード例 #2
0
        // To show (list) all guest on index view.
        /// <summary>Indexes this instance.</summary>
        /// <returns> Guest list in view</returns>
        public ActionResult Index()
        {
            GuestListContext   guestListContext = new GuestListContext();
            List <ListOfGuest> guests           = guestListContext.ListOfGuest.ToList();

            return(View(guests));
        }