Skip to content

Commit 79b25de

Browse files
committed
chore: rm unused code
1 parent 201a837 commit 79b25de

File tree

1 file changed

+3
-42
lines changed

1 file changed

+3
-42
lines changed

src/JsonApiDotNetCore/Hooks/Execution/AffectedRelationships.cs

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public interface IAffectedRelationships<TDependentResource> : IAffectedRelations
1818
/// Gets a dictionary of all entities grouped by affected relationship.
1919
/// </summary>
2020
Dictionary<RelationshipAttribute, HashSet<TDependentResource>> AllByRelationships();
21-
2221
/// <summary>
2322
/// Gets a dictionary of all entities that have an affected relationship to type <typeparamref name="TPrincipalResource"/>
2423
/// </summary>
@@ -32,6 +31,9 @@ public interface IAffectedRelationships<TDependentResource> : IAffectedRelations
3231
/// <inheritdoc />
3332
public class AffectedRelationships<TDependentResource> : IAffectedRelationships<TDependentResource> where TDependentResource : class, IIdentifiable
3433
{
34+
/// <summary>
35+
/// Helper method that "unboxes" the TValue from the relationship dictionary
36+
/// </summary>
3537
internal static Dictionary<RelationshipAttribute, HashSet<TDependentResource>> ConvertRelationshipDictionary(Dictionary<RelationshipAttribute, IEnumerable> relationships)
3638
{
3739
return relationships.ToDictionary(pair => pair.Key, pair => (HashSet<TDependentResource>)pair.Value);
@@ -71,45 +73,4 @@ public Dictionary<RelationshipAttribute, HashSet<TDependentResource>> GetByRelat
7173
return _groups?.Where(p => p.Key.PrincipalType == principalType).ToDictionary(p => p.Key, p => p.Value);
7274
}
7375
}
74-
75-
///// <inheritdoc />
76-
//public class AffectedRelationships<TDependentResource> : ReadOnlyDictionary<RelationshipAttribute, HashSet<TDependentResource>>, IAffectedRelationships<TDependentResource> where TDependentResource : class, IIdentifiable
77-
//{
78-
// private readonly Dictionary<RelationshipAttribute, HashSet<TDependentResource>> _groups;
79-
80-
// private static IDictionary<RelationshipAttribute, HashSet<TDependentResource>> test(Dictionary<RelationshipAttribute, IEnumerable> relationship)
81-
// {
82-
// return relationship.ToDictionary(kvp => kvp.Key, kvp => new HashSet<TDependentResource>((IEnumerable<TDependentResource>)kvp.Value));
83-
// }
84-
85-
// public AffectedRelationships(Dictionary<RelationshipAttribute, IEnumerable> relationship) : base(test(relationship))
86-
// {
87-
// }
88-
89-
90-
// /// <inheritdoc />
91-
// public AffectedRelationships(Dictionary<RelationshipAttribute, IEnumerable> relationships)
92-
// {
93-
// _groups = relationships.ToDictionary(kvp => kvp.Key, kvp => new HashSet<TDependentResource>((IEnumerable<TDependentResource>)kvp.Value));
94-
// }
95-
96-
// public Dictionary<RelationshipAttribute, HashSet<TDependentResource>> AllByRelationships()
97-
// {
98-
// return _groups;
99-
// }
100-
101-
102-
103-
// /// <inheritdoc />
104-
// public Dictionary<RelationshipAttribute, HashSet<TDependentResource>> GetByRelationship<TPrincipalResource>() where TPrincipalResource : class, IIdentifiable
105-
// {
106-
// return GetByRelationship(typeof(TPrincipalResource));
107-
// }
108-
109-
// /// <inheritdoc />
110-
// public Dictionary<RelationshipAttribute, HashSet<TDependentResource>> GetByRelationship(Type principalType)
111-
// {
112-
// return _groups?.Where(p => p.Key.PrincipalType == principalType).ToDictionary(p => p.Key, p => p.Value);
113-
// }
114-
//}
11576
}

0 commit comments

Comments
 (0)