summaryrefslogtreecommitdiff
path: root/Controllers/BundleController.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-02-22 07:55:59 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-02-22 07:55:59 +0300
commit71a3253a72fcd888a750c7e412c236603061c58c (patch)
treef1b1741307377767915728705054cffa30756297 /Controllers/BundleController.cs
parent44b78ff30cdab292d0e2635a28b53d9f48b2e087 (diff)
Bundle Controller refactoring
Diffstat (limited to 'Controllers/BundleController.cs')
-rw-r--r--Controllers/BundleController.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Controllers/BundleController.cs b/Controllers/BundleController.cs
index 8e72dd3..fe52a6e 100644
--- a/Controllers/BundleController.cs
+++ b/Controllers/BundleController.cs
@@ -8,7 +8,6 @@ namespace MyDarling.Controllers
public class BundleController : Controller
{
private DataContext context;
- public bool TryUpdateModel { get; private set; }
public BundleController(DataContext context)
{
@@ -46,7 +45,7 @@ namespace MyDarling.Controllers
public async Task<ActionResult> Details(int id)
{
- return View(await context.UnderwearBundles.FindAsync(id));
+ return View(await context.UnderwearBundles.Include(b => b.Figures).Where(b => b.Id == id).FirstOrDefaultAsync());
}
public async Task<ActionResult> Edit(int id)
@@ -71,7 +70,7 @@ namespace MyDarling.Controllers
if (await TryUpdateModelAsync<UnderwearBundle>(
bundle,
"",
- b => b.Name, b => b.Description, b => b.Price))
+ b => b.Name, b => b.Description, b => b.Figures, b => b.Price))
{
try
{