Skip to content

Commit 95974a6

Browse files
Maurits MoeysMaurits Moeys
Maurits Moeys
authored and
Maurits Moeys
committed
chore: styling
1 parent 6ee3679 commit 95974a6

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/JsonApiDotNetCore/Hooks/Execution/DiffableEntityHashSet.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal DiffableEntityHashSet(IEnumerable requestEntities,
5454
Dictionary<RelationshipAttribute, IEnumerable> relationships,
5555
IJsonApiContext jsonApiContext)
5656
: this((HashSet<TResource>)requestEntities, (HashSet<TResource>)databaseEntities, TypeHelper.ConvertRelationshipDictionary<TResource>(relationships),
57-
TypeHelper.ConvertAttributesToUpdate(jsonApiContext.AttributesToUpdate, (HashSet<TResource>)requestEntities))
57+
TypeHelper.ConvertAttributeDictionary(jsonApiContext.AttributesToUpdate, (HashSet<TResource>)requestEntities))
5858
{ }
5959

6060

src/JsonApiDotNetCore/Internal/TypeHelper.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Linq;
55
using System.Linq.Expressions;
66
using System.Reflection;
7-
using JsonApiDotNetCore.Hooks;
87
using JsonApiDotNetCore.Models;
98

109
namespace JsonApiDotNetCore.Internal
@@ -81,8 +80,6 @@ public static Type GetTypeOfList(Type type)
8180
return null;
8281
}
8382

84-
85-
8683
/// <summary>
8784
/// Gets the property info that is referenced in the NavigatioAction expression.
8885
/// Credits: https://stackoverflow.com/a/17116267/4441216
@@ -100,7 +97,9 @@ public static PropertyInfo ParseNavigationExpression<TResource>(Expression<Func<
10097
Exp = (MemberExpression)UnExp.Operand;
10198
}
10299
else
100+
{
103101
throw new ArgumentException();
102+
}
104103
}
105104
else if (NavigationExpression.Body is MemberExpression)
106105
{
@@ -144,7 +143,6 @@ public static object CreateInstanceOfOpenType(Type openType, Type[] parameters,
144143
return Activator.CreateInstance(parameterizedType, constructorArguments);
145144
}
146145

147-
148146
/// <summary>
149147
/// Helper method that "unboxes" the TValue from the relationship dictionary into
150148
/// </summary>

test/UnitTests/ResourceHooks/AffectedEntitiesHelperTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ public class Dummy : Identifiable
1212
public string SomeUpdatedProperty { get; set; }
1313
public string SomeNotUpdatedProperty { get; set; }
1414

15-
1615
[HasOne("first-to-one")]
1716
public ToOne FirstToOne { get; set; }
1817
[HasOne("second-to-one")]
1918
public ToOne SecondToOne { get; set; }
2019
[HasMany("to-manies")]
2120
public List<ToMany> ToManies { get; set; }
2221
}
22+
2323
public class NotTargeted : Identifiable { }
2424
public class ToMany : Identifiable { }
2525
public class ToOne : Identifiable { }

0 commit comments

Comments
 (0)