Refactored namespaces for ordering.infrastructure project
This commit is contained in:
parent
0c52323f8d
commit
c007047291
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class BuyerEntityTypeConfiguration
|
class BuyerEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<Buyer>
|
: IEntityTypeConfiguration<Buyer>
|
||||||
{
|
{
|
||||||
@ -38,4 +33,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
navigation.SetPropertyAccessMode(PropertyAccessMode.Field);
|
navigation.SetPropertyAccessMode(PropertyAccessMode.Field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class CardTypeEntityTypeConfiguration
|
class CardTypeEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<CardType>
|
: IEntityTypeConfiguration<CardType>
|
||||||
{
|
{
|
||||||
@ -24,4 +19,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class ClientRequestEntityTypeConfiguration
|
class ClientRequestEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<ClientRequest>
|
: IEntityTypeConfiguration<ClientRequest>
|
||||||
{
|
{
|
||||||
@ -16,4 +11,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
requestConfiguration.Property(cr => cr.Time).IsRequired();
|
requestConfiguration.Property(cr => cr.Time).IsRequired();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class OrderEntityTypeConfiguration : IEntityTypeConfiguration<Order>
|
class OrderEntityTypeConfiguration : IEntityTypeConfiguration<Order>
|
||||||
{
|
{
|
||||||
public void Configure(EntityTypeBuilder<Order> orderConfiguration)
|
public void Configure(EntityTypeBuilder<Order> orderConfiguration)
|
||||||
@ -83,4 +76,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
.HasForeignKey("_orderStatusId");
|
.HasForeignKey("_orderStatusId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class OrderItemEntityTypeConfiguration
|
class OrderItemEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<OrderItem>
|
: IEntityTypeConfiguration<OrderItem>
|
||||||
{
|
{
|
||||||
@ -56,4 +51,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
.IsRequired(false);
|
.IsRequired(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class OrderStatusEntityTypeConfiguration
|
class OrderStatusEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<OrderStatus>
|
: IEntityTypeConfiguration<OrderStatus>
|
||||||
{
|
{
|
||||||
@ -24,4 +19,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ordering.Infrastructure.EntityConfigurations
|
|
||||||
{
|
|
||||||
class PaymentMethodEntityTypeConfiguration
|
class PaymentMethodEntityTypeConfiguration
|
||||||
: IEntityTypeConfiguration<PaymentMethod>
|
: IEntityTypeConfiguration<PaymentMethod>
|
||||||
{
|
{
|
||||||
@ -62,4 +56,3 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
.HasForeignKey("_cardTypeId");
|
.HasForeignKey("_cardTypeId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency
|
|
||||||
{
|
|
||||||
public class ClientRequest
|
public class ClientRequest
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public DateTime Time { get; set; }
|
public DateTime Time { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency
|
|
||||||
{
|
|
||||||
public interface IRequestManager
|
public interface IRequestManager
|
||||||
{
|
{
|
||||||
Task<bool> ExistAsync(Guid id);
|
Task<bool> ExistAsync(Guid id);
|
||||||
|
|
||||||
Task CreateRequestForCommandAsync<T>(Guid id);
|
Task CreateRequestForCommandAsync<T>(Guid id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using Ordering.Domain.Exceptions;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency
|
|
||||||
{
|
|
||||||
public class RequestManager : IRequestManager
|
public class RequestManager : IRequestManager
|
||||||
{
|
{
|
||||||
private readonly OrderingContext _context;
|
private readonly OrderingContext _context;
|
||||||
@ -40,4 +36,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempoten
|
|||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,19 +1,5 @@
|
|||||||
using MediatR;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
|
||||||
using Ordering.Infrastructure;
|
|
||||||
using Ordering.Infrastructure.EntityConfigurations;
|
|
||||||
using System;
|
|
||||||
using System.Data;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure
|
|
||||||
{
|
|
||||||
public class OrderingContext : DbContext, IUnitOfWork
|
public class OrderingContext : DbContext, IUnitOfWork
|
||||||
{
|
{
|
||||||
public const string DEFAULT_SCHEMA = "ordering";
|
public const string DEFAULT_SCHEMA = "ordering";
|
||||||
@ -153,4 +139,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories
|
|
||||||
{
|
|
||||||
public class BuyerRepository
|
public class BuyerRepository
|
||||||
: IBuyerRepository
|
: IBuyerRepository
|
||||||
{
|
{
|
||||||
@ -65,4 +58,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
|||||||
return buyer;
|
return buyer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories
|
|
||||||
{
|
|
||||||
public class OrderRepository
|
public class OrderRepository
|
||||||
: IOrderRepository
|
: IOrderRepository
|
||||||
{
|
{
|
||||||
@ -60,4 +53,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
|||||||
_context.Entry(order).State = EntityState.Modified;
|
_context.Entry(order).State = EntityState.Modified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user