Skip to content

Commit be440a9

Browse files
committed
Removing PaymentMethod property from order
1 parent 4c7f92f commit be440a9

5 files changed

Lines changed: 266 additions & 4 deletions

File tree

src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170405110939_NoPaymentMethodPropertyInOrder.Designer.cs

Lines changed: 244 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Microsoft.EntityFrameworkCore.Migrations;
4+
5+
namespace Ordering.API.Migrations
6+
{
7+
public partial class NoPaymentMethodPropertyInOrder : Migration
8+
{
9+
protected override void Up(MigrationBuilder migrationBuilder)
10+
{
11+
12+
}
13+
14+
protected override void Down(MigrationBuilder migrationBuilder)
15+
{
16+
17+
}
18+
}
19+
}

src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ partial class OrderingContextModelSnapshot : ModelSnapshot
1313
protected override void BuildModel(ModelBuilder modelBuilder)
1414
{
1515
modelBuilder
16-
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752")
16+
.HasAnnotation("ProductVersion", "1.1.1")
1717
.HasAnnotation("SqlServer:Sequence:.orderitemseq", "'orderitemseq', '', '1', '10', '', '', 'Int64', 'False'")
1818
.HasAnnotation("SqlServer:Sequence:ordering.buyerseq", "'buyerseq', 'ordering', '1', '10', '', '', 'Int64', 'False'")
1919
.HasAnnotation("SqlServer:Sequence:ordering.orderseq", "'orderseq', 'ordering', '1', '10', '', '', 'Int64', 'False'")
@@ -226,7 +226,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
226226
.HasForeignKey("OrderStatusId")
227227
.OnDelete(DeleteBehavior.Cascade);
228228

229-
b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", "PaymentMethod")
229+
b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod")
230230
.WithMany()
231231
.HasForeignKey("PaymentMethodId");
232232
});

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class Order
3636
// It's much cheaper than .ToList() because it will not have to copy all items in a new collection. (Just one heap alloc for the wrapper instance)
3737
//https://msdn.microsoft.com/en-us/library/e78dcd75(v=vs.110).aspx
3838

39-
public PaymentMethod PaymentMethod { get; private set; }
4039
private int? _paymentMethodId;
4140

4241
protected Order() { }

src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void ConfigureOrder(EntityTypeBuilder<Order> orderConfiguration)
154154
//Set as Field (New since EF 1.1) to access the OrderItem collection property through its field
155155
navigation.SetPropertyAccessMode(PropertyAccessMode.Field);
156156

157-
orderConfiguration.HasOne(o => o.PaymentMethod)
157+
orderConfiguration.HasOne<PaymentMethod>()
158158
.WithMany()
159159
.HasForeignKey("PaymentMethodId")
160160
.IsRequired(false)

0 commit comments

Comments
 (0)