summaryrefslogtreecommitdiff
path: root/Controllers/BundlesController.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-02-16 08:28:59 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-02-16 08:28:59 +0300
commite4b4105ec0802dd0f1b735e5cb7fba083a0ffe0c (patch)
treed857967fb3f6bf5ce7caa7359d4b4f864d5b2bc9 /Controllers/BundlesController.cs
parent9107bb6788428a3504adbeea2bc5c060e17f895d (diff)
Add edit page
Diffstat (limited to 'Controllers/BundlesController.cs')
-rw-r--r--Controllers/BundlesController.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Controllers/BundlesController.cs b/Controllers/BundlesController.cs
index 5c0fc0e..8b66139 100644
--- a/Controllers/BundlesController.cs
+++ b/Controllers/BundlesController.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
using MyDarling.Models;
namespace MyDarling.Controllers
@@ -6,15 +7,20 @@ namespace MyDarling.Controllers
public class BundlesController : Controller
{
private IRepository repository;
-
+
public BundlesController(IRepository repository)
{
this.repository = repository;
}
-
+
public ActionResult Index()
{
return View(repository);
}
+
+ public ActionResult Edit(int id)
+ {
+ return View(repository.Bundles.Where(b => b.Id == id).FirstOrDefault());
+ }
}
} \ No newline at end of file