Reputation: 2379
So I am trying to call a function in another class called DMLib. If I were to return a List of structs, how can I properly bring that back into my main. For example:
Struct:
public struct folder
{
public int FID;
public string Name;
public int Type;
public int TotalMessages;
}
Class member decleration:
public List<folder> getFolders(string sessionKey)
Class member call from main.cs:
List<folder> folders = new List<folder>();
folders = (List<folder>)DMLib.getFolders(sessionkey);
Error:
This error says that my List of struct folder that is defined in my main.cs can not be converted into the List of struct folder from my class. How can I make this conversion happen?
Upvotes: 0
Views: 84
Reputation: 20935
Either change the declaration of the folder
Type to be fully qualified to include the namespace, or declare using
aliases at the top, for each of the namespaces that the two folder
types reside in, and use the alias in your code.
Upvotes: 1