diff --git a/src/SIL.Harmony/Changes/CreateChange.cs b/src/SIL.Harmony/Changes/CreateChange.cs index 6127449..85a2660 100644 --- a/src/SIL.Harmony/Changes/CreateChange.cs +++ b/src/SIL.Harmony/Changes/CreateChange.cs @@ -1,9 +1,12 @@ +using Microsoft.EntityFrameworkCore.Infrastructure; + namespace SIL.Harmony.Changes; public abstract class CreateChange(Guid entityId) : Change(entityId) where T : class { public override ValueTask ApplyChange(T entity, IChangeContext context) { - throw new NotSupportedException($"type {GetType().Name} does not support ApplyChange, because it inherits from {nameof(CreateChange)}, this means it must be called with a new Guid and not one from an existing entity"); + //won't be called because it's skipped by the base class for CreateChange + return default; } } diff --git a/src/SIL.Harmony/Changes/EditChange.cs b/src/SIL.Harmony/Changes/EditChange.cs index cdb0a24..8dbbe6b 100644 --- a/src/SIL.Harmony/Changes/EditChange.cs +++ b/src/SIL.Harmony/Changes/EditChange.cs @@ -1,3 +1,5 @@ +using Microsoft.EntityFrameworkCore.Infrastructure; + namespace SIL.Harmony.Changes; public abstract class EditChange(Guid entityId) : Change(entityId) @@ -6,6 +8,6 @@ public abstract class EditChange(Guid entityId) : Change(entityId) public override ValueTask NewEntity(Commit commit, IChangeContext context) { throw new NotSupportedException( - $"type {GetType().Name} does not support NewEntity, because it inherits from {nameof(EditChange)}, this means it must be called with a from an existing entity, not a newly generated one"); + $"type {GetType().ShortDisplayName()} does not support NewEntity, because it inherits from {nameof(EditChange)}, this means it must be called with an existing entity, not a newly generated one. CommitId: {commit.Id}, EntityId: {EntityId}"); } }