public void UpdateGameType(GameType gameType) { context.Entry(gameType).State = EntityState.Modified; }
public void CreateGameType(GameType gameType) { context.GameTypes.Add(gameType); context.SaveChanges(); }
public ActionResult NewGameType(GameType gameType, IEnumerable<HttpPostedFileBase> files) { db.CreateGameType(gameType); foreach (var file in files) { if (file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/Games/" + gameType.gameTypeName), fileName); file.SaveAs(path); } } return RedirectToAction("Index"); }