diff options
Diffstat (limited to 'Controllers')
-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 |