Skip to content

Improve usability RequestSerializer #611

Closed
@maurei

Description

@maurei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions