MS ResourceManagementClient.GetResources overload issue

Lee, Jeff 20 Reputation points
2024-07-01T17:37:49.0033333+00:00

I am new to C#. When I put following code in VS 2017 it shows error message:

Error CS1503 Argument 2: cannot convert from 'int' to 'System.Collections.Generic.IEnumerable<string>'

Error CS1503 Argument 3: cannot convert from 'string' to 'System.Globalization.CultureInfo'

It cannot be the overload issue as Microsoft indeed has the corresponding overload method:

ResourceManagementClient.GetResources Method (String, Int32, IEnumerable<String>)

So it must be something I did not code correctly. Then what is it?

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Lithnet.ResourceManagement.Client;

namespace MIM_Module

{

public class Program

{ 

    static void Attributes(string[] args)

    {

        ResourceManagementClient MIMClient = new ResourceManagementClient();

        SearchResultCollection SrchRslts = MIMClient.GetResources("/BindingDescription[(BoundAttributeType = /Set[ObjectID = '3b953247-93733cf6605f']/ComputedMember)]", 10, "BoundAttributeType");

    }

}
```}
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,637 questions
0 comments No comments
{count} votes

Accepted answer
  1. gekka 8,061 Reputation points MVP
    2024-07-02T04:03:52.73+00:00

    Do you want to use GetResoruces(string filter, int pageSize, IEnumerable<string> attributesToGet)?

    SearchResultCollection SrchRslts 
        = MIMClient.GetResources
        ("/BindingDescription[(BoundAttributeType = /Set[ObjectID = '3b953247-93733cf6605f']/ComputedMember)]"
        , 10
        , new string[] { "BoundAttributeType" });
    
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lee, Jeff 20 Reputation points
    2024-07-02T15:42:19.2666667+00:00

    Yes, that was my intention. I implemented your changes and it works! Thanks a lot.

    0 comments No comments