Do not allow creation of entities from admin pages.

This commit is contained in:
2019-11-08 20:38:06 +00:00
parent 8db64d17ae
commit 2fdeb744b6
62 changed files with 0 additions and 4179 deletions

View File

@@ -35,28 +35,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
return View(device);
}
// GET: Admin/Devices/Create
public IActionResult Create() => View();
// POST: Admin/Devices/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost, ValidateAntiForgeryToken]
public async Task<IActionResult> Create(
[Bind("AddedWhen,ModifiedWhen,OptimalMultipleSectorsRead,Id,CompactFlash,Manufacturer,Model,Revision,Type")]
Device device)
{
if(ModelState.IsValid)
{
_context.Add(device);
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));
}
return View(device);
}
// GET: Admin/Devices/Edit/5
public async Task<IActionResult> Edit(int? id)
{