Changed Model: 1:n for CD:Product

pull/1/head
Basimodo 2021-06-25 12:04:16 +07:00
parent 16d3651113
commit b3d9d8c80a
2 changed files with 4 additions and 3 deletions

@ -366,7 +366,7 @@ namespace Gremlin.GremlinData.DBClasses
public void Configure(EntityTypeBuilder<Product> entity)
{
entity.HasKey(e => e.ProductId);
entity.HasOne(d => d.CustomDescription).WithOne(p => p.Product);
entity.HasOne(d => d.CustomDescription).WithMany(p => p.Products);
//entity.HasOne(p => p.ProductLine).WithMany(d => d.Products);
entity.Property(e => e.DataCreationDate)
.HasColumnType("TIMESTAMP")
@ -424,7 +424,7 @@ namespace Gremlin.GremlinData.DBClasses
public void Configure(EntityTypeBuilder<CustomDescription> entity)
{
entity.HasKey(e => e.CustomDescriptionId);
entity.HasOne(p => p.Product).WithOne(d => d.CustomDescription)
entity.HasMany(p => p.Products).WithOne(d => d.CustomDescription)
//.HasForeignKey("ProductId")
;
entity.Property(e => e.DataCreationDate)

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace Gremlin.GremlinData.EntityClasses
{
@ -13,7 +14,7 @@ namespace Gremlin.GremlinData.EntityClasses
public uint AccountId { get; set; }
//navigation properties:
public Product Product { get; set; }
public List<Product> Products { get; set; }
public Account Supplier { get; set; }
//standard properties: