Skip to content

Dynamics 365 Function Parameters (need to remove quote) #931

Description

@Slackter

Hello,

We are utilizing the latest version of this library very heavily without any issues at all so it's been great. We are in need of executing a function and need to specify a function parameter in a very specific format.

The function requires a parameter of Target=@tgt (@tgt can be anything) but there must be NO quotes at all.

If I run use the following code:
client.For<SystemUser>.Key(userGuid).Function("RetrievePrincipalAccess").Set(new { Target = "@tgt })

the library will generate a URL as follows:
https://server/api/data/systemusers(userGuid)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target='@tgt')

when it needs to be:
https://server/api/data/systemusers(userGuid)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target=@tgt)

Is there any way to remove the single quotes the Set() is adding to my URL?

I was able to get this working by using the BuildRequestFor() and modifying the RequestUri directly, but I am unable to write proper unit tests since the ODataRequest has only internal constructors and is un-mockable.

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