0
0

Init bundle controller

This commit is contained in:
Sergey Chebotar 2023-02-06 07:11:05 +03:00
parent d1ca742017
commit a2314e870e
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using MyDarling.Models;
namespace MyDarling.Controllers
{
public class BundleController : Controller
{
private DataContext context;
public BundleController(DataContext context)
{
this.context = context;
}
public async Task<IActionResult> Show(int id)
{
return View(await context.UnderwearBundles.FindAsync(id));
}
}
}

14
Views/Bundle/Show.cshtml Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>@Model?.Name</title>
</head>
<body>
<p>@Model?.Name</p>
<p>@Model?.Description</p>
</body>
</html>

View File

@ -71,7 +71,7 @@
{ {
<div class="col mb-5"> <div class="col mb-5">
<div class="card h-100"> <div class="card h-100">
<img class="card-img-top" src="@bundle.Figures.FirstOrDefault().FilePath" alt="..." /> <a href="/bundle/show/@bundle.Id"><img class="card-img-top" src="@bundle.Figures.FirstOrDefault()?.FilePath" alt="..." /></a>
<div class="card-body p-4"> <div class="card-body p-4">
<div class="text-center"> <div class="text-center">
<h5 class="fw-bolder">@bundle.Name</h5> <h5 class="fw-bolder">@bundle.Name</h5>