From 01d11dabd8eb72fbff16dbe1cee9df2ef80a8bf9 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 29 Dec 2021 12:01:34 +0300 Subject: [PATCH] Fixed IOrderingServiceDbContext missing implementation --- .../IOrderingServiceDbContext.cs | 7 ++++++- .../OrderingServiceDbContext.cs | 20 ++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs index 1dbb06ff..79fd4625 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs @@ -1,4 +1,7 @@ -using Volo.Abp.Data; +using EShopOnAbp.OrderingService.Buyers; +using EShopOnAbp.OrderingService.Orders; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; namespace EShopOnAbp.OrderingService.EntityFrameworkCore @@ -9,5 +12,7 @@ namespace EShopOnAbp.OrderingService.EntityFrameworkCore /* Add DbSet for each Aggregate Root here. Example: * DbSet Questions { get; } */ + DbSet Buyers { get; } + DbSet Orders { get; } } } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContext.cs b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContext.cs index 21006f56..afef93c7 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContext.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContext.cs @@ -9,8 +9,7 @@ using Volo.Abp.EntityFrameworkCore.Modeling; namespace EShopOnAbp.OrderingService.EntityFrameworkCore { [ConnectionStringName(OrderingServiceDbProperties.ConnectionStringName)] - public class OrderingServiceDbContext : - AbpDbContext + public class OrderingServiceDbContext : AbpDbContext, IOrderingServiceDbContext { public virtual DbSet Buyers { get; set; } public virtual DbSet Orders { get; set; } @@ -43,10 +42,7 @@ namespace EShopOnAbp.OrderingService.EntityFrameworkCore { b.ToTable(OrderingServiceDbProperties.DbTablePrefix + "Orders", OrderingServiceDbProperties.DbSchema); b.ConfigureByConvention(); //auto configure for the base class props - b.OwnsOne(o => o.Address, a => - { - a.WithOwner(); - }); + b.OwnsOne(o => o.Address, a => { a.WithOwner(); }); b.Property("_orderStatusId").UsePropertyAccessMode(PropertyAccessMode.Field) .HasColumnName("OrderStatusId") .IsRequired(); @@ -84,12 +80,12 @@ namespace EShopOnAbp.OrderingService.EntityFrameworkCore b.ConfigureByConvention(); //auto configure for the base class props b.Property("OrderId").IsRequired(); - b.Property(q=>q.ProductId).IsRequired(); - b.Property(q=>q.ProductName).IsRequired(); - b.Property(q=>q.Discount).IsRequired(); - b.Property(q=>q.UnitPrice).IsRequired(); - b.Property(q=>q.Units).IsRequired(); - b.Property(q=>q.PictureUrl).IsRequired(false); + b.Property(q => q.ProductId).IsRequired(); + b.Property(q => q.ProductName).IsRequired(); + b.Property(q => q.Discount).IsRequired(); + b.Property(q => q.UnitPrice).IsRequired(); + b.Property(q => q.Units).IsRequired(); + b.Property(q => q.PictureUrl).IsRequired(false); }); } }