public ActionResult Details(int ID) { string userName = User.Identity.Name.Substring(0, User.Identity.Name.IndexOf("@")).ToLower(); List <BookModel> books = new List <BookModel>(); books = BookProcessor.GetData(userName); BookModel specialBook = new BookModel(); specialBook = books.Find(b => b.ID == ID); return(View(specialBook)); }
public ActionResult DisplayBook() { string userName = User.Identity.Name.Substring(0, User.Identity.Name.IndexOf("@")).ToLower(); List <BookModel> books = new List <BookModel>(); var data = BookProcessor.GetData(userName); foreach (BookModel row in data) { books.Add(new BookModel { ID = row.ID, GegStdKurz = row.GegStdKurz, Klasse = row.Klasse, Kurztitel = row.Kurztitel, Verlag = row.Verlag, Preis = row.Preis, LehrKurz = row.LehrKurz }); } return(View(books)); }