data refactor (#27)
* Refactoring to move data access code into Infrastructure project * Fixing namespaces
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
@@ -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")]
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user