Init bundle controller
This commit is contained in:
parent
3f54d070e7
commit
e0085417df
18
Controllers/BundleController.cs
Normal file
18
Controllers/BundleController.cs
Normal 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
14
Views/Bundle/Show.cshtml
Normal 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>
|
@ -72,7 +72,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>
|
||||||
|
Loading…
Reference in New Issue
Block a user