7.3.1 Adding a Controller; Listing 7-6 The Initial Contents of the Product Controller.cs File

This commit is contained in:
Jason Zhu 2021-09-08 10:42:58 +10:00
parent 56a61c71c8
commit 5cced2c5d9
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SportsStore.Domain.Abstract;
namespace SportsStore.WebUI.Controllers
{
public class ProductController : Controller
{
private IProductRepository repository;
public ProductController(IProductRepository productRepository)
{
this.repository = productRepository;
}
}
}

View File

@ -109,6 +109,7 @@
<ItemGroup>
<Compile Include="App_Start\NinjectWebCommon.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Controllers\ProductController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
@ -127,8 +128,8 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Controllers\" />
<Folder Include="Models\" />
<Folder Include="Views\Product\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SportsStore.Domain\SportsStore.Domain.csproj">