diff options
-rw-r--r-- | Controllers/BundleController.cs | 18 | ||||
-rw-r--r-- | Views/Bundle/Show.cshtml | 14 | ||||
-rw-r--r-- | Views/Home/Index.cshtml | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/Controllers/BundleController.cs b/Controllers/BundleController.cs new file mode 100644 index 0000000..8ec1030 --- /dev/null +++ b/Controllers/BundleController.cs @@ -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)); + } + } +}
\ No newline at end of file diff --git a/Views/Bundle/Show.cshtml b/Views/Bundle/Show.cshtml new file mode 100644 index 0000000..8d3e055 --- /dev/null +++ b/Views/Bundle/Show.cshtml @@ -0,0 +1,14 @@ +<!DOCTYPE html> + +<html> + +<head> + <title>@Model?.Name</title> +</head> + +<body> + <p>@Model?.Name</p> + <p>@Model?.Description</p> +</body> + +</html> diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 8149c41..5a368de 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -72,7 +72,7 @@ { <div class="col mb-5"> <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="text-center"> <h5 class="fw-bolder">@bundle.Name</h5> |