From a2314e870e1f3f966e45532984e3c76a430334af Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Mon, 6 Feb 2023 07:11:05 +0300 Subject: [PATCH] Init bundle controller --- Controllers/BundleController.cs | 18 ++++++++++++++++++ Views/Bundle/Show.cshtml | 14 ++++++++++++++ Views/Home/Index.cshtml | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Controllers/BundleController.cs create mode 100644 Views/Bundle/Show.cshtml 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 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 @@ + + + + + + @Model?.Name + + + +

@Model?.Name

+

@Model?.Description

+ + + diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index cd9f21f..71e16da 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -71,7 +71,7 @@ {
- ... + ...
@bundle.Name