Skip to content

Commit 2fdc6e2

Browse files
committed
catalog fake service is in place.
1 parent 43cbd62 commit 2fdc6e2

16 files changed

Lines changed: 189 additions & 0 deletions

src/Web/Catalog.WebForms/Catalog.WebForms/Catalog.WebForms.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
<WarningLevel>4</WarningLevel>
4545
</PropertyGroup>
4646
<ItemGroup>
47+
<Reference Include="Autofac, Version=4.3.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
48+
<HintPath>..\packages\Autofac.4.3.0\lib\net45\Autofac.dll</HintPath>
49+
</Reference>
4750
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4851
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
4952
</Reference>
@@ -204,10 +207,17 @@
204207
<Compile Include="Default.aspx.designer.cs">
205208
<DependentUpon>Default.aspx</DependentUpon>
206209
</Compile>
210+
<Compile Include="Extensions\ObservableExtensions.cs" />
207211
<Compile Include="Global.asax.cs">
208212
<DependentUpon>Global.asax</DependentUpon>
209213
</Compile>
214+
<Compile Include="Models\CatalogBrand.cs" />
215+
<Compile Include="Models\CatalogItem.cs" />
216+
<Compile Include="Models\CatalogType.cs" />
210217
<Compile Include="Properties\AssemblyInfo.cs" />
218+
<Compile Include="Services\CatalogMockService.cs" />
219+
<Compile Include="Services\Common.cs" />
220+
<Compile Include="Services\ICatalogService.cs" />
211221
<Compile Include="Site.Master.cs">
212222
<DependentUpon>Site.Master</DependentUpon>
213223
<SubType>ASPXCodeBehind</SubType>
595 KB
Loading
560 KB
Loading
503 KB
Loading
81.3 KB
Loading
498 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Collections.Generic;
2+
using System.Collections.ObjectModel;
3+
4+
namespace eShopOnContainers.Core.Extensions
5+
{
6+
public static class ObservableExtension
7+
{
8+
public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> source)
9+
{
10+
ObservableCollection<T> collection = new ObservableCollection<T>();
11+
12+
try
13+
{
14+
foreach (T item in source)
15+
{
16+
collection.Add(item);
17+
}
18+
19+
return collection;
20+
}
21+
// Really?
22+
catch
23+
{
24+
return collection;
25+
}
26+
}
27+
}
28+
}

src/Web/Catalog.WebForms/Catalog.WebForms/Global.asax.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ void Application_Start(object sender, EventArgs e)
1616
// Code that runs on application startup
1717
RouteConfig.RegisterRoutes(RouteTable.Routes);
1818
BundleConfig.RegisterBundles(BundleTable.Bundles);
19+
20+
// Register Containers:
21+
22+
1923
}
2024
}
2125
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Taken from https://github.com/dotnet/eShopOnContainers/blob/vs2017/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs
2+
// Issue: How to make this DRY and still support the monolithic lift and shift scenario?
3+
4+
namespace eShopOnContainers.Core.Models.Catalog
5+
{
6+
public class CatalogBrand
7+
{
8+
public int Id { get; set; }
9+
public string Brand { get; set; }
10+
11+
public override string ToString() => Brand;
12+
}
13+
}

0 commit comments

Comments
 (0)