-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from Cratis:generalize-change-tracking
Making the target object on Changeset generic
- Loading branch information
Showing
57 changed files
with
559 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
// Copyright (c) Cratis. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Dynamic; | ||
|
||
namespace Cratis.Changes | ||
{ | ||
/// <summary> | ||
/// Defines a change as part of a <see cref="Changeset{T}"/>. | ||
/// Defines a change as part of a <see cref="Changeset{TSource, TTarget}"/>. | ||
/// </summary> | ||
/// <param name="State">State after change applied.</param> | ||
public record Change(ExpandoObject State); | ||
public record Change(object State); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
// Copyright (c) Cratis. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Dynamic; | ||
using Cratis.Properties; | ||
|
||
namespace Cratis.Changes | ||
{ | ||
/// <summary> | ||
/// Represents a child that has been added to a parent. | ||
/// </summary> | ||
/// <param name="State">State of the object being added.</param> | ||
/// <param name="Child">State of the object being added.</param> | ||
/// <param name="ChildrenProperty">The property holding the children in the parent object.</param> | ||
/// <param name="IdentifiedByProperty">The property that identifies the key on the child object.</param> | ||
/// <param name="Key">Key of the object.</param> | ||
public record ChildAdded(ExpandoObject State, Property ChildrenProperty, Property IdentifiedByProperty, object Key) : Change(State); | ||
public record ChildAdded(object Child, PropertyPath ChildrenProperty, PropertyPath IdentifiedByProperty, object Key) : Change(Child); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// Copyright (c) Cratis. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Dynamic; | ||
using Cratis.Properties; | ||
|
||
namespace Cratis.Changes | ||
{ | ||
/// <summary> | ||
/// Represents properties that has been changed on a child. | ||
/// </summary> | ||
/// <typeparam name="TTarget">Target type.</typeparam> | ||
/// <param name="State">State after change applied.</param> | ||
/// <param name="ChildrenProperty">The property holding the children in the parent object.</param> | ||
/// <param name="IdentifiedByProperty">The property that identifies the key on the child object.</param> | ||
/// <param name="Key">Key of the object.</param> | ||
/// <param name="Differences">The differences between initial state and a change.</param> | ||
public record ChildPropertiesChanged(ExpandoObject State, Property ChildrenProperty, Property IdentifiedByProperty, object Key, IEnumerable<PropertyDifference> Differences) : Change(State); | ||
public record ChildPropertiesChanged<TTarget>(object State, PropertyPath ChildrenProperty, PropertyPath IdentifiedByProperty, object Key, IEnumerable<PropertyDifference<TTarget>> Differences) : Change(State); | ||
} |
Oops, something went wrong.