/// <inheritdoc /> public HashSet <TResource> GetAffected(Expression <Func <TResource, object> > navigationAction) { ArgumentGuard.NotNull(navigationAction, nameof(navigationAction)); PropertyInfo property = HooksNavigationParser.ParseNavigationExpression(navigationAction); return(this.Where(pair => pair.Key.Property.Name == property.Name).Select(pair => pair.Value).SingleOrDefault()); }
/// <inheritdoc /> public override HashSet <TResource> GetAffected(Expression <Func <TResource, object> > navigationAction) { ArgumentGuard.NotNull(navigationAction, nameof(navigationAction)); PropertyInfo propertyInfo = HooksNavigationParser.ParseNavigationExpression(navigationAction); Type propertyType = propertyInfo.PropertyType; if (propertyType.IsOrImplementsInterface(typeof(IEnumerable))) { propertyType = CollectionConverter.TryGetCollectionElementType(propertyType); } if (propertyType.IsOrImplementsInterface(typeof(IIdentifiable))) { // the navigation action references a relationship. Redirect the call to the relationship dictionary. return(base.GetAffected(navigationAction)); } return(_updatedAttributes.TryGetValue(propertyInfo, out HashSet <TResource> resources) ? resources : new HashSet <TResource>()); }