Minor refactoring and Unit Test fix
This commit is contained in:
parent
92cd474d34
commit
fa6a273a33
@ -52,7 +52,9 @@
|
|||||||
{
|
{
|
||||||
options.UseSqlServer(Configuration["ConnectionString"],
|
options.UseSqlServer(Configuration["ConnectionString"],
|
||||||
sqlop => sqlop.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name));
|
sqlop => sqlop.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name));
|
||||||
});
|
},
|
||||||
|
ServiceLifetime.Scoped
|
||||||
|
);
|
||||||
|
|
||||||
services.AddSwaggerGen();
|
services.AddSwaggerGen();
|
||||||
services.ConfigureSwaggerGen(options =>
|
services.ConfigureSwaggerGen(options =>
|
||||||
|
@ -13,6 +13,14 @@
|
|||||||
{
|
{
|
||||||
private readonly OrderingContext _context;
|
private readonly OrderingContext _context;
|
||||||
|
|
||||||
|
public IUnitOfWork UnitOfWork
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _context;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BuyerRepository(OrderingContext context)
|
public BuyerRepository(OrderingContext context)
|
||||||
{
|
{
|
||||||
if (context == null)
|
if (context == null)
|
||||||
@ -23,14 +31,6 @@
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IUnitOfWork UnitOfWork
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Buyer Add(Buyer buyer)
|
public Buyer Add(Buyer buyer)
|
||||||
{
|
{
|
||||||
return _context.Buyers
|
return _context.Buyers
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
{
|
{
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands;
|
using Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Repositories;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
using Moq;
|
using Moq;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user