Browse Source

Moving entity models to Business project

main
Steve Smith 9 years ago
parent
commit
c9a69a3105
  1. 2
      src/Business/Business.csproj
  2. 8
      src/Business/Entities/CatalogBrand.cs
  3. 4
      src/Business/Entities/CatalogItem.cs
  4. 9
      src/Business/Entities/CatalogType.cs
  5. 3
      src/Web/.dockerignore
  6. 6
      src/Web/Dockerfile
  7. 2
      src/Web/Infrastructure/CatalogContext.cs
  8. 2
      src/Web/Infrastructure/CatalogContextSeed.cs
  9. 15
      src/Web/Models/CatalogBrand.cs
  10. 14
      src/Web/Models/CatalogType.cs
  11. 2
      src/Web/Services/CatalogService.cs
  12. 2
      src/Web/ViewModels/Catalog.cs
  13. 4
      src/Web/ViewModels/CatalogIndex.cs
  14. 1
      src/Web/Web.csproj

2
src/Business/Business.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>

8
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; }
}
}

4
src/Web/Models/CatalogItem.cs → src/Business/Entities/CatalogItem.cs

@ -1,6 +1,4 @@
using System;
namespace Microsoft.eShopWeb.Models
namespace Microsoft.eShopWeb.Business.Entities
{
public class CatalogItem
{

9
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; }
}
}

3
src/Web/.dockerignore

@ -1,3 +0,0 @@
*
!obj/Docker/publish/*
!obj/Docker/empty/

6
src/Web/Dockerfile

@ -1,6 +0,0 @@
FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "eShopWeb.dll"]

2
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
{

2
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;

15
src/Web/Models/CatalogBrand.cs

@ -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; }
}
}

14
src/Web/Models/CatalogType.cs

@ -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; }
}
}

2
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
{

2
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

4
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

1
src/Web/Web.csproj

@ -28,7 +28,6 @@
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0-msbuild3-final" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
<Folder Include="Pics\" />
<Folder Include="Views\Catalog\" />
<Folder Include="wwwroot\css\catalog\" />

Loading…
Cancel
Save