From 93a0db201f0e84e4729665aa3e974bc83f2f8632 Mon Sep 17 00:00:00 2001 From: Donald Gray Date: Wed, 15 May 2024 16:37:01 +0100 Subject: [PATCH] Remove unused navigation properties Primarily removed to avoid serialisation issue but they are reduntant. --- src/protagonist/DLCS.Model/Assets/ImageDeliveryChannel.cs | 2 -- src/protagonist/DLCS.Model/Policies/DeliveryChannelPolicy.cs | 5 ----- src/protagonist/DLCS.Repository/DlcsContext.cs | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/protagonist/DLCS.Model/Assets/ImageDeliveryChannel.cs b/src/protagonist/DLCS.Model/Assets/ImageDeliveryChannel.cs index c04ae53ff..b4c8b0826 100644 --- a/src/protagonist/DLCS.Model/Assets/ImageDeliveryChannel.cs +++ b/src/protagonist/DLCS.Model/Assets/ImageDeliveryChannel.cs @@ -15,8 +15,6 @@ public class ImageDeliveryChannel /// The image id for the attached asset /// public AssetId ImageId { get; set; } - - public Asset Asset { get; set; } /// /// The channel this policy applies to diff --git a/src/protagonist/DLCS.Model/Policies/DeliveryChannelPolicy.cs b/src/protagonist/DLCS.Model/Policies/DeliveryChannelPolicy.cs index b2be7a437..8fd762643 100644 --- a/src/protagonist/DLCS.Model/Policies/DeliveryChannelPolicy.cs +++ b/src/protagonist/DLCS.Model/Policies/DeliveryChannelPolicy.cs @@ -54,11 +54,6 @@ public class DeliveryChannelPolicy /// The custom policy /// public string PolicyData { get; set; } - - /// - /// List of delivery channels attached to the image - /// - public List ImageDeliveryChannels { get; set; } } public static class KnownDeliveryChannelPolicies diff --git a/src/protagonist/DLCS.Repository/DlcsContext.cs b/src/protagonist/DLCS.Repository/DlcsContext.cs index 3f0a85948..c8bc534ed 100644 --- a/src/protagonist/DLCS.Repository/DlcsContext.cs +++ b/src/protagonist/DLCS.Repository/DlcsContext.cs @@ -667,7 +667,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) aId => aId.ToString(), id => AssetId.FromString(id)); - entity.HasOne(e => e.Asset) + entity.HasOne() .WithMany(e => e.ImageDeliveryChannels) .HasForeignKey(e => e.ImageId); });