Xrm.Tools.CRMWebAPI icon indicating copy to clipboard operation
Xrm.Tools.CRMWebAPI copied to clipboard

Latest downloadable nuget 1.0.24 does not match github

Open siggipop opened this issue 1 year ago • 0 comments

I notice the nuget packaged contained some code that looked unfinished or different from github branch

From github master branch the Get method start like so:

public async Task<ResultType> Get<ResultType>(string entityCollection, string key, CRMGetListOptions QueryOptions = null)
{
    await CheckAuthToken();

    string fullUrl = string.Empty;
    if (key.Equals(Guid.Empty.ToString()) || String.IsNullOrEmpty(key))
        fullUrl = BuildGetUrl(entityCollection, QueryOptions);
    else
        fullUrl = BuildGetUrl(entityCollection + "(" + key + ")", QueryOptions);
    HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), fullUrl);

But in the Nuget packet 1.0.24, the method starts like so:

public async Task<ResultType> Get<ResultType>(string entityCollection, string key, CRMGetListOptions QueryOptions = null)
{
   await CheckAuthToken();
   _ = string.Empty;
   HttpRequestMessage request = new HttpRequestMessage(requestUri: (!key.Equals(Guid.Empty.ToString()) && !string.IsNullOrEmpty(key)) ? BuildGetUrl(entityCollection + "(" + key + ")", QueryOptions) : BuildGetUrl(entityCollection, QueryOptions), method: new HttpMethod("GET"));
   if (QueryOptions?.FormattedValues ?? false)
   {
       request.Headers.Add("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");
   }

siggipop avatar Mar 23 '24 16:03 siggipop