Browse Source

Fixed IOrderingServiceDbContext missing implementation

pull/51/head
Galip Tolga Erdem 4 years ago
parent
commit
01d11dabd8
  1. 7
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs
  2. 20
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContext.cs

7
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<Question> Questions { get; }
*/
DbSet<Buyer> Buyers { get; }
DbSet<Order> Orders { get; }
}
}

20
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<OrderingServiceDbContext>
public class OrderingServiceDbContext : AbpDbContext<OrderingServiceDbContext>, IOrderingServiceDbContext
{
public virtual DbSet<Buyer> Buyers { get; set; }
public virtual DbSet<Order> 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<int>("_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<Guid>("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);
});
}
}

Loading…
Cancel
Save