Skip to content

Commit d7a61cd

Browse files
committed
Ensured Move() overload properly functions
This is embarrassing, but it seems the basic `Move()` overload in `TopicRepositoryBase` doesn't refer to the more complete `Move()` overload, nor does it do so in any of the concrete implementations. As a result, it is effectively unimplemented, and won't persist any changes to the database. This is fixed here by simply referring it to the more complete overload (which additionally accepts `sibling`). This also exposes a bigger issue: Most of these `public` methods should be marked as `abstract` since they're not fully implemented, and just intended to provide common support. That breaks the public contract, though, so will need to wait for 5.0.0.
1 parent dcdbab2 commit d7a61cd

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

OnTopic/Repositories/TopicRepositoryBase.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,7 @@ topic is ContentTypeDescriptor descriptor &&
387387
| METHOD: MOVE
388388
\-------------------------------------------------------------------------------------------------------------------------*/
389389
/// <inheritdoc />
390-
public virtual void Move([ValidatedNotNull]Topic topic, [ValidatedNotNull]Topic target) {
391-
392-
/*------------------------------------------------------------------------------------------------------------------------
393-
| Validate parameters
394-
\-----------------------------------------------------------------------------------------------------------------------*/
395-
Contract.Requires(target != topic);
396-
Contract.Requires(topic, "The topic parameter must be specified.");
397-
Contract.Requires(target, "The target parameter must be specified.");
398-
if (topic.Parent != target) {
399-
MoveEvent?.Invoke(this, new MoveEventArgs(topic, target));
400-
topic.SetParent(target);
401-
}
402-
403-
}
390+
public virtual void Move([ValidatedNotNull]Topic topic, [ValidatedNotNull]Topic target) => Move(topic, target, null);
404391

405392
/// <summary>
406393
/// Interface method that supports moving a topic from one position to another.

0 commit comments

Comments
 (0)