c# - Returning Struct from Class -
c# - Returning Struct from Class -
so trying phone call function in class called dmlib. if homecoming list of structs, how can bring main. example:
struct:
public struct folder { public int fid; public string name; public int type; public int totalmessages; }
class fellow member decleration:
public list<folder> getfolders(string sessionkey)
class fellow member phone call main.cs:
list<folder> folders = new list<folder>(); folders = (list<folder>)dmlib.getfolders(sessionkey);
error:
this error says list of struct folder defined in main.cs can not converted list of struct folder class. how can create conversion happen?
either alter declaration of folder
type qualified include namespace, or declare using
aliases @ top, each of namespaces 2 folder
types reside in, , utilize alias in code.
c# struct return
Comments
Post a Comment