// GET: Product // TODO:IFベースに置き換えてFactoryからDBContextを取得するように変更 // TODO:サニタイズ // TODO:ValidateAntiForgeryTokenの使い方を調べる public ActionResult Index(string artistName) { if (artistName == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var context = new ProductContext(); var data = context.GetAllByArtistName(artistName); ViewBag.artistName = artistName; return(View(data)); }