creating car

This commit is contained in:
ani_konarcheva@abv.bg
2022-04-05 20:05:03 +03:00
parent 562bc7ad32
commit 34427d59a4
6 changed files with 10 additions and 17 deletions

View File

@@ -21,7 +21,6 @@ namespace WebApp.Controllers
_context = context;
}
// GET: Cars
public async Task<IActionResult> Index()
{
return View(await _context.Cars.ToListAsync());
@@ -47,6 +46,7 @@ namespace WebApp.Controllers
// GET: Cars/Create
[Authorize(Roles = "Admin")]
[HttpGet]
public IActionResult Create()
{
return View();
@@ -69,6 +69,7 @@ namespace WebApp.Controllers
}
// GET: Cars/Edit/5
[HttpGet]
public async Task<IActionResult> Edit(int? id)
{
if (id == null)
@@ -120,6 +121,7 @@ namespace WebApp.Controllers
}
// GET: Cars/Delete/5
[HttpGet]
public async Task<IActionResult> Delete(int? id)
{
if (id == null)

View File

@@ -23,16 +23,6 @@ namespace API.Controllers
return View();
}
public IActionResult Privacy()
{
if(!this.User.Identity.IsAuthenticated)
{
return Redirect("");
}
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{