Fix selecting logo to remove.

This commit is contained in:
2019-05-26 23:24:08 +01:00
parent 75e36ef83b
commit 5a1010ca3a
2 changed files with 4 additions and 2 deletions

View File

@@ -334,7 +334,9 @@ namespace cicm_web.Areas.Admin.Controllers
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)
{
CompanyLogo companyLogo = await _context.CompanyLogos.FindAsync(id);
CompanyLogo companyLogo = await _context.CompanyLogos.FirstOrDefaultAsync(m => m.Id == id);
if(companyLogo == null) return NotFound();
_context.CompanyLogos.Remove(companyLogo);
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>3.0.99.574</Version>
<Version>3.0.99.576</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>