From c9a69a3105dd95427d3cf83a290ae63108372bb0 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Wed, 22 Mar 2017 21:04:39 -0400 Subject: [PATCH] Moving entity models to Business project --- src/Business/Business.csproj | 2 +- src/Business/Entities/CatalogBrand.cs | 8 ++++++++ .../Models => Business/Entities}/CatalogItem.cs | 4 +--- src/Business/Entities/CatalogType.cs | 9 +++++++++ src/Web/.dockerignore | 3 --- src/Web/Dockerfile | 6 ------ src/Web/Infrastructure/CatalogContext.cs | 2 +- src/Web/Infrastructure/CatalogContextSeed.cs | 2 +- src/Web/Models/CatalogBrand.cs | 15 --------------- src/Web/Models/CatalogType.cs | 14 -------------- src/Web/Services/CatalogService.cs | 2 +- src/Web/ViewModels/Catalog.cs | 2 +- src/Web/ViewModels/CatalogIndex.cs | 4 ++-- src/Web/Web.csproj | 1 - 14 files changed, 25 insertions(+), 49 deletions(-) create mode 100644 src/Business/Entities/CatalogBrand.cs rename src/{Web/Models => Business/Entities}/CatalogItem.cs (90%) create mode 100644 src/Business/Entities/CatalogType.cs delete mode 100644 src/Web/.dockerignore delete mode 100644 src/Web/Dockerfile delete mode 100644 src/Web/Models/CatalogBrand.cs delete mode 100644 src/Web/Models/CatalogType.cs diff --git a/src/Business/Business.csproj b/src/Business/Business.csproj index 954020d..9eca547 100644 --- a/src/Business/Business.csproj +++ b/src/Business/Business.csproj @@ -1,4 +1,4 @@ - + netstandard1.4 diff --git a/src/Business/Entities/CatalogBrand.cs b/src/Business/Entities/CatalogBrand.cs new file mode 100644 index 0000000..e016395 --- /dev/null +++ b/src/Business/Entities/CatalogBrand.cs @@ -0,0 +1,8 @@ +namespace Microsoft.eShopWeb.Business.Entities +{ + public class CatalogBrand + { + public int Id { get; set; } + public string Brand { get; set; } + } +} diff --git a/src/Web/Models/CatalogItem.cs b/src/Business/Entities/CatalogItem.cs similarity index 90% rename from src/Web/Models/CatalogItem.cs rename to src/Business/Entities/CatalogItem.cs index ec857a7..aedc288 100644 --- a/src/Web/Models/CatalogItem.cs +++ b/src/Business/Entities/CatalogItem.cs @@ -1,6 +1,4 @@ -using System; - -namespace Microsoft.eShopWeb.Models +namespace Microsoft.eShopWeb.Business.Entities { public class CatalogItem { diff --git a/src/Business/Entities/CatalogType.cs b/src/Business/Entities/CatalogType.cs new file mode 100644 index 0000000..2842b43 --- /dev/null +++ b/src/Business/Entities/CatalogType.cs @@ -0,0 +1,9 @@ +namespace Microsoft.eShopWeb.Business.Entities +{ + public class CatalogType + { + public int Id { get; set; } + + public string Type { get; set; } + } +} diff --git a/src/Web/.dockerignore b/src/Web/.dockerignore deleted file mode 100644 index d8f8175..0000000 --- a/src/Web/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!obj/Docker/publish/* -!obj/Docker/empty/ diff --git a/src/Web/Dockerfile b/src/Web/Dockerfile deleted file mode 100644 index 010cee1..0000000 --- a/src/Web/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM microsoft/aspnetcore:1.1 -ARG source -WORKDIR /app -EXPOSE 80 -COPY ${source:-obj/Docker/publish} . -ENTRYPOINT ["dotnet", "eShopWeb.dll"] diff --git a/src/Web/Infrastructure/CatalogContext.cs b/src/Web/Infrastructure/CatalogContext.cs index 84bab28..795d53d 100644 --- a/src/Web/Infrastructure/CatalogContext.cs +++ b/src/Web/Infrastructure/CatalogContext.cs @@ -1,8 +1,8 @@ namespace Microsoft.eShopWeb.Infrastructure { - using eShopWeb.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; + using Microsoft.eShopWeb.Business.Entities; public class CatalogContext : DbContext { diff --git a/src/Web/Infrastructure/CatalogContextSeed.cs b/src/Web/Infrastructure/CatalogContextSeed.cs index c67baeb..a83a5aa 100644 --- a/src/Web/Infrastructure/CatalogContextSeed.cs +++ b/src/Web/Infrastructure/CatalogContextSeed.cs @@ -1,8 +1,8 @@ namespace Microsoft.eShopWeb.Infrastructure { - using eShopWeb.Models; using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; + using Microsoft.eShopWeb.Business.Entities; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; diff --git a/src/Web/Models/CatalogBrand.cs b/src/Web/Models/CatalogBrand.cs deleted file mode 100644 index 7b9e855..0000000 --- a/src/Web/Models/CatalogBrand.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Microsoft.eShopWeb.Models -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - - public class CatalogBrand - { - public int Id { get; set; } - - public string Brand { get; set; } - } -} diff --git a/src/Web/Models/CatalogType.cs b/src/Web/Models/CatalogType.cs deleted file mode 100644 index a7a959b..0000000 --- a/src/Web/Models/CatalogType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Microsoft.eShopWeb.Models -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - public class CatalogType - { - public int Id { get; set; } - - public string Type { get; set; } - } -} diff --git a/src/Web/Services/CatalogService.cs b/src/Web/Services/CatalogService.cs index d2a54f0..13b6406 100644 --- a/src/Web/Services/CatalogService.cs +++ b/src/Web/Services/CatalogService.cs @@ -1,12 +1,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.eShopWeb.Models; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using Microsoft.eShopWeb.Infrastructure; using Microsoft.eShopWeb.ViewModels; +using Microsoft.eShopWeb.Business.Entities; namespace Microsoft.eShopWeb.Services { diff --git a/src/Web/ViewModels/Catalog.cs b/src/Web/ViewModels/Catalog.cs index b66ac26..f70d91f 100644 --- a/src/Web/ViewModels/Catalog.cs +++ b/src/Web/ViewModels/Catalog.cs @@ -1,4 +1,4 @@ -using Microsoft.eShopWeb.Models; +using Microsoft.eShopWeb.Business.Entities; using System.Collections.Generic; namespace Microsoft.eShopWeb.ViewModels diff --git a/src/Web/ViewModels/CatalogIndex.cs b/src/Web/ViewModels/CatalogIndex.cs index fc2ea7f..2b57e00 100644 --- a/src/Web/ViewModels/CatalogIndex.cs +++ b/src/Web/ViewModels/CatalogIndex.cs @@ -1,5 +1,5 @@ -using Microsoft.eShopWeb.Models; -using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.eShopWeb.Business.Entities; using System.Collections.Generic; namespace Microsoft.eShopWeb.ViewModels diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj index d807d5c..bb6cde5 100644 --- a/src/Web/Web.csproj +++ b/src/Web/Web.csproj @@ -28,7 +28,6 @@ -