OData action parameter as type Dictionary<string, object>? RRS feed

  • Question

  • User1263422540 posted

    I am trying to define an action that takes two parameters one a string and one a Dictionary<string, object>. When I build an edm model I specify the type of the parameters like:

    var createPresentationFromTemplate = templates.EntityType.Action("CreatePresentationFromTemplate");

    createPresentationFromTemplate.Parameter<Dictionary<string, object>>("PresentationProperties");

    When I put a breakpoint in the server the ODataActionParameters parameters always comes back as null. Does anyone have an example of an OData action that takes a Dictionary<U,B> as a parameter type?

    Thank you.

    Thursday, October 17, 2013 4:07 PM

All replies

  • User1519735232 posted

    ActionPayload holds the Parameter names and values provided by a client in a POST request to invoke a particular Action. The Parameter values are stored in the dictionary keyed using the Parameter name.

    Thursday, October 24, 2013 3:04 AM
  • User1263422540 posted

    This I know. "The Parameter values are stored in the dictionary keyed using the Parameter name." I want to know if the Parameter type can be something other than an int or string? I want the parameter type to be a Dictionary<string, object>. So say I have three parameters:

    Name Type
    ---- ----
    A    int
    B    string
    C    Dictionary<string, object>

    Is this possible?

    Thursday, October 24, 2013 9:55 AM