public IActionResult Edit(string id, RandomCamModel model) { if (!ModelState.IsValid) { return(View(model)); } var result = this.camera.ById(int.Parse(id)); if (User.Identity.Name != result.UserName) { return(RedirectToAction(nameof(All))); } this.camera.Edit( int.Parse(id), model.Make, model.CameraModel, model.Price, model.Quantity, model.MinShutterSpeed, model.MaxShutterSpeed, model.MinISO, model.MaxISO, model.IsFullFrame, model.VideoResolution, model.Description, model.ImageUrl ); return(RedirectToAction(nameof(All))); }
public IActionResult Delete(int id, RandomCamModel model) { this.camera.Delete(id); return(RedirectToAction(nameof(All))); }