diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-02-16 08:28:59 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-02-16 08:28:59 +0300 |
commit | e4b4105ec0802dd0f1b735e5cb7fba083a0ffe0c (patch) | |
tree | d857967fb3f6bf5ce7caa7359d4b4f864d5b2bc9 /Controllers/BundlesController.cs | |
parent | 9107bb6788428a3504adbeea2bc5c060e17f895d (diff) |
Add edit page
Diffstat (limited to 'Controllers/BundlesController.cs')
-rw-r--r-- | Controllers/BundlesController.cs | 10 |
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 |