Skip to content

Improve usability RequestSerializer #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maurei opened this issue Nov 2, 2019 · 0 comments
Closed

Improve usability RequestSerializer #611

maurei opened this issue Nov 2, 2019 · 0 comments

Comments

@maurei
Copy link
Member

maurei commented Nov 2, 2019

The SetAttributesToSerialize function takes an expression to select attributes to serialize in the request document:

void SetAttributesToSerialize<TResource>(Expression<Func<TResource, dynamic>> filter) where TResource : class, IIdentifiable;

And similar for selection of relationship fields. Currently the serializer then resolves the actual AttrAttributes and RelationshipAttributes using the resource graph.

There are two problems with this setup

  • When the list of attributes/relationships is only known at runtime it is very complicated to use the serializer: you'll need to construct a Expression<Func<TResource, dynamic>> instead of just being able to pass that a list of attributes/relationships
  • The serializer should not be responsible for resolving AttrAttributes and RelationshipAttributes from and expression: the IResourceGraph service does that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant