Consider the below code:
var list = new SomeServiceType
{
Url = "htp://www.test.com/",
Credentials = new NetworkCredential(UserName, Password)
};
This code has been repeated many say as 10 times. So, I decided to use a common function that accepting this above code when passing different type.
I need to get the Url and Credentials as the response from newly created function.
For reference, SomeServiceType is ServiceNowType, UserName and Password are type String.
I tried with
public List<object>(....strucked here...)
{
...
return ...//again strucked here....(neeed to return url and credentials)..
}
url is of type string and NetworkCredential is of c# class