Add catalog pictures. Set port to 5106.
@ -7,6 +7,8 @@ using eShopWeb.Models.CatalogViewModels;
|
|||||||
using eShopWeb.Models;
|
using eShopWeb.Models;
|
||||||
using eShopWeb.Models.Pagination;
|
using eShopWeb.Models.Pagination;
|
||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||||
|
|
||||||
@ -14,6 +16,14 @@ namespace eShopWeb.Controllers
|
|||||||
{
|
{
|
||||||
public class CatalogController : Controller
|
public class CatalogController : Controller
|
||||||
{
|
{
|
||||||
|
private readonly IHostingEnvironment _env;
|
||||||
|
|
||||||
|
public CatalogController(IHostingEnvironment env)
|
||||||
|
{
|
||||||
|
_env = env;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// GET: /<controller>/
|
// GET: /<controller>/
|
||||||
public IActionResult Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page)
|
public IActionResult Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page)
|
||||||
{
|
{
|
||||||
@ -43,6 +53,18 @@ namespace eShopWeb.Controllers
|
|||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("{id}")]
|
||||||
|
[Route("[controller]/pic/{id}")]
|
||||||
|
// GET: /<controller>/pic/{id}
|
||||||
|
public IActionResult GetImage(int id)
|
||||||
|
{
|
||||||
|
var contentRoot = _env.ContentRootPath + "//Pics";
|
||||||
|
var path = Path.Combine(contentRoot, id + ".png");
|
||||||
|
Byte[] b = System.IO.File.ReadAllBytes(path);
|
||||||
|
return File(b, "image/png");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static IEnumerable<SelectListItem> GetPreconfiguredCatalogBrands()
|
static IEnumerable<SelectListItem> GetPreconfiguredCatalogBrands()
|
||||||
{
|
{
|
||||||
@ -73,18 +95,18 @@ namespace eShopWeb.Controllers
|
|||||||
{
|
{
|
||||||
return new List<CatalogItem>()
|
return new List<CatalogItem>()
|
||||||
{
|
{
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Bot Black Sweatshirt", Name = ".NET Bot Black Sweatshirt", Price = 19.5M, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/1" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Bot Black Sweatshirt", Name = ".NET Bot Black Sweatshirt", Price = 19.5M, PictureUri = "http://localhost:5106/catalog/pic/1" },
|
||||||
new CatalogItem() { CatalogTypeId=1,CatalogBrandId=2, Description = ".NET Black & White Mug", Name = ".NET Black & White Mug", Price= 8.50M, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/2" },
|
new CatalogItem() { CatalogTypeId=1,CatalogBrandId=2, Description = ".NET Black & White Mug", Name = ".NET Black & White Mug", Price= 8.50M, PictureUri = "http://localhost:5106/catalog/pic/2" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Prism White T-Shirt", Name = "Prism White T-Shirt", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/3" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Prism White T-Shirt", Name = "Prism White T-Shirt", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/3" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Foundation Sweatshirt", Name = ".NET Foundation Sweatshirt", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/4" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Foundation Sweatshirt", Name = ".NET Foundation Sweatshirt", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/4" },
|
||||||
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=5, Description = "Roslyn Red Sheet", Name = "Roslyn Red Sheet", Price = 8.5M, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/5" },
|
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=5, Description = "Roslyn Red Sheet", Name = "Roslyn Red Sheet", Price = 8.5M, PictureUri = "http://localhost:5106/catalog/pic/5" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Blue Sweatshirt", Name = ".NET Blue Sweatshirt", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/6" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=2, Description = ".NET Blue Sweatshirt", Name = ".NET Blue Sweatshirt", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/6" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Roslyn Red T-Shirt", Name = "Roslyn Red T-Shirt", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/7" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Roslyn Red T-Shirt", Name = "Roslyn Red T-Shirt", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/7" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Kudu Purple Sweatshirt", Name = "Kudu Purple Sweatshirt", Price = 8.5M, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/8" },
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Kudu Purple Sweatshirt", Name = "Kudu Purple Sweatshirt", Price = 8.5M, PictureUri = "http://localhost:5106/catalog/pic/8" },
|
||||||
new CatalogItem() { CatalogTypeId=1,CatalogBrandId=5, Description = "Cup<T> White Mug", Name = "Cup<T> White Mug", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/9" },
|
new CatalogItem() { CatalogTypeId=1,CatalogBrandId=5, Description = "Cup<T> White Mug", Name = "Cup<T> White Mug", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/9" },
|
||||||
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=2, Description = ".NET Foundation Sheet", Name = ".NET Foundation Sheet", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/10" },
|
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=2, Description = ".NET Foundation Sheet", Name = ".NET Foundation Sheet", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/10" },
|
||||||
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=2, Description = "Cup<T> Sheet", Name = "Cup<T> Sheet", Price = 8.5M, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/11" },
|
new CatalogItem() { CatalogTypeId=3,CatalogBrandId=2, Description = "Cup<T> Sheet", Name = "Cup<T> Sheet", Price = 8.5M, PictureUri = "http://localhost:5106/catalog/pic/11" },
|
||||||
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Prism White TShirt", Name = "Prism White TShirt", Price = 12, PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/pic/12" }
|
new CatalogItem() { CatalogTypeId=2,CatalogBrandId=5, Description = "Prism White TShirt", Name = "Prism White TShirt", Price = 12, PictureUri = "http://localhost:5106/catalog/pic/12" }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
src/Web/WebMonolithic/eShopWeb/Pics/1.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/10.png
Normal file
After Width: | Height: | Size: 223 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/11.png
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/12.png
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/2.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/3.png
Normal file
After Width: | Height: | Size: 170 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/4.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/5.png
Normal file
After Width: | Height: | Size: 226 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/6.png
Normal file
After Width: | Height: | Size: 179 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/7.png
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/8.png
Normal file
After Width: | Height: | Size: 167 KiB |
BIN
src/Web/WebMonolithic/eShopWeb/Pics/9.png
Normal file
After Width: | Height: | Size: 40 KiB |
@ -13,6 +13,7 @@ namespace eShopWeb
|
|||||||
{
|
{
|
||||||
var host = new WebHostBuilder()
|
var host = new WebHostBuilder()
|
||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
|
.UseUrls("http://0.0.0.0:5106")
|
||||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"windowsAuthentication": false,
|
"windowsAuthentication": false,
|
||||||
"anonymousAuthentication": true,
|
"anonymousAuthentication": true,
|
||||||
"iisExpress": {
|
"iisExpress": {
|
||||||
"applicationUrl": "http://localhost:58298/",
|
"applicationUrl": "http://localhost:5106/",
|
||||||
"sslPort": 0
|
"sslPort": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -7,6 +7,36 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Pics\1.png" />
|
||||||
|
<None Remove="Pics\10.png" />
|
||||||
|
<None Remove="Pics\11.png" />
|
||||||
|
<None Remove="Pics\12.png" />
|
||||||
|
<None Remove="Pics\2.png" />
|
||||||
|
<None Remove="Pics\3.png" />
|
||||||
|
<None Remove="Pics\4.png" />
|
||||||
|
<None Remove="Pics\5.png" />
|
||||||
|
<None Remove="Pics\6.png" />
|
||||||
|
<None Remove="Pics\7.png" />
|
||||||
|
<None Remove="Pics\8.png" />
|
||||||
|
<None Remove="Pics\9.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Pics\1.png" />
|
||||||
|
<Content Include="Pics\10.png" />
|
||||||
|
<Content Include="Pics\11.png" />
|
||||||
|
<Content Include="Pics\12.png" />
|
||||||
|
<Content Include="Pics\2.png" />
|
||||||
|
<Content Include="Pics\3.png" />
|
||||||
|
<Content Include="Pics\4.png" />
|
||||||
|
<Content Include="Pics\5.png" />
|
||||||
|
<Content Include="Pics\6.png" />
|
||||||
|
<Content Include="Pics\7.png" />
|
||||||
|
<Content Include="Pics\8.png" />
|
||||||
|
<Content Include="Pics\9.png" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="1.0.3" />
|
<PackageReference Include="Microsoft.AspNetCore" Version="1.0.3" />
|
||||||
|