data refactor (#27)

* Refactoring to move data access code into Infrastructure project

* Fixing namespaces
This commit is contained in:
Steve Smith
2017-08-07 10:08:41 -04:00
committed by GitHub
parent b67f8cc050
commit 084db74c77
9 changed files with 17 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.eShopWeb.ApplicationCore.Entities;
namespace Microsoft.eShopWeb.Infrastructure
namespace Infrastructure.Data
{
public class CatalogContext : DbContext

View File

@@ -1,14 +1,13 @@
namespace Microsoft.eShopWeb.Infrastructure
{
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Infrastructure.Data
{
public class CatalogContextSeed
{
public static async Task SeedAsync(IApplicationBuilder applicationBuilder, ILoggerFactory loggerFactory, int? retry = 0)

View File

@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Migrations
namespace Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
[Migration("20170302162241_Initial")]

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microsoft.eShopWeb.Infrastructure.Migrations
namespace Infrastructure.Data.Migrations
{
public partial class Initial : Migration
{

View File

@@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
namespace Microsoft.eShopWeb.Infrastructure.Migrations
namespace Infrastructure.Data.Migrations
{
[DbContext(typeof(CatalogContext))]
partial class CatalogContextModelSnapshot : ModelSnapshot

View File

@@ -1,9 +1,9 @@
using ApplicationCore.Interfaces;
using System.Threading.Tasks;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using Microsoft.eShopWeb.Infrastructure;
using Microsoft.EntityFrameworkCore;
using System;
using Infrastructure.Data;
namespace Web.Services
{

View File

@@ -4,12 +4,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Microsoft.eShopWeb.Infrastructure;
using Microsoft.eShopWeb.ViewModels;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using System.Data.SqlClient;
using Dapper;
using Microsoft.Extensions.Logging;
using Infrastructure.Data;
namespace Microsoft.eShopWeb.Services
{

View File

@@ -1,5 +1,4 @@
using Microsoft.eShopWeb.Infrastructure;
using Microsoft.eShopWeb.Services;
using Microsoft.eShopWeb.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
@@ -17,6 +16,7 @@ using Infrastructure.Logging;
using Microsoft.AspNetCore.Identity;
using Web.Services;
using ApplicationCore.Services;
using Infrastructure.Data;
namespace Microsoft.eShopWeb
{