Hi!
I am using Dictionary, to store two string key and value pairs.
public void SomeMethod(Model myModel) { public Dictionary<string, string> myDictionary = new Dictionary<string, string>(); foreach(var email in myModel.GetEsEmails) { myDictionary.Add(email.Id,email.EmailAddress); } CreateEmailList(myDictionary); }
Service Method public void CreateEmailList(List<KeyValuePair<string,string>> emailTo) { }
When I call the service method and pass myDictionary as a parameter.
I get this error like below.
Argument Type ‘System.Collections.Generic.Dictionary<string,string> ‘ is not assignable to parameter type ‘System.Collections.Generic.KeyValuePair<string,string>[]’
Please give suggestions, would I need to do a cast.
Thank you,