Skip to content

Commit 29abae0

Browse files
committed
refactor: renamed AffectedRelationships
1 parent b8df749 commit 29abae0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/JsonApiDotNetCore/Hooks/Execution/UpdatedRelationshipHelper.cs renamed to src/JsonApiDotNetCore/Hooks/Execution/AffectedRelationships.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public interface IAffectedRelationships<TDependent> : IAffectedRelationships whe
2828
Dictionary<RelationshipAttribute, HashSet<TDependent>> GetByRelationship(Type principalType);
2929
}
3030

31-
public class UpdatedRelationshipHelper<TDependent> : IAffectedRelationships<TDependent> where TDependent : class, IIdentifiable
31+
public class AffectedRelationships<TDependent> : IAffectedRelationships<TDependent> where TDependent : class, IIdentifiable
3232
{
3333
private readonly Dictionary<RelationshipProxy, HashSet<TDependent>> _groups;
3434

3535
public Dictionary<RelationshipAttribute, HashSet<TDependent>> AllByRelationships()
3636
{
3737
return _groups?.ToDictionary(p => p.Key.Attribute, p => p.Value);
3838
}
39-
public UpdatedRelationshipHelper(Dictionary<RelationshipProxy, IEnumerable> relationships)
39+
public AffectedRelationships(Dictionary<RelationshipProxy, IEnumerable> relationships)
4040
{
4141
_groups = relationships.ToDictionary(kvp => kvp.Key, kvp => new HashSet<TDependent>((IEnumerable<TDependent>)kvp.Value));
4242
}

src/JsonApiDotNetCore/Hooks/Execution/EntityDiff.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IEntityDiff<TEntity> : IAffectedRelationships<TEntity> where TE
1919
HashSet<TEntity> DatabaseEntities { get; }
2020
}
2121

22-
public class EntityDiff<TEntity> : UpdatedRelationshipHelper<TEntity>, IEntityDiff<TEntity> where TEntity : class, IIdentifiable
22+
public class EntityDiff<TEntity> : AffectedRelationships<TEntity>, IEntityDiff<TEntity> where TEntity : class, IIdentifiable
2323
{
2424
public HashSet<TEntity> RequestEntities { get; private set; }
2525
public HashSet<TEntity> DatabaseEntities { get; private set; }

src/JsonApiDotNetCore/Hooks/ResourceHookExecutor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ object ThrowJsonApiExceptionOnError(Func<object> action)
343343
}
344344

345345
/// <summary>
346-
/// Helper method to instantiate UpdatedRelationshipHelper for a given <paramref name="entityType"/>
346+
/// Helper method to instantiate AffectedRelationships for a given <paramref name="entityType"/>
347347
/// If <paramref name="dbValues"/> are included, the values of the entries in <paramref name="prevLayerRelationships"/> need to be replaced with these values.
348348
/// </summary>
349349
/// <returns>The relationship helper.</returns>
350350
IAffectedRelationships CreateRelationshipHelper(DependentType entityType, Dictionary<RelationshipProxy, IEnumerable> prevLayerRelationships, IEnumerable dbValues = null)
351351
{
352352
if (dbValues != null) ReplaceWithDbValues(prevLayerRelationships, dbValues.Cast<IIdentifiable>());
353-
return (IAffectedRelationships)TypeHelper.CreateInstanceOfOpenType(typeof(UpdatedRelationshipHelper<>), entityType, prevLayerRelationships);
353+
return (IAffectedRelationships)TypeHelper.CreateInstanceOfOpenType(typeof(AffectedRelationships<>), entityType, prevLayerRelationships);
354354
}
355355

356356
/// <summary>

0 commit comments

Comments
 (0)