c# - How to return IEnumerable type as object -


i have var (ienumerable) wanted return class.

public myclass method(string str)     {         ...................         var p1 = data;         return ?                 }  public class myclass {     public string { get; set; }     public string b { get; set; }     public bool c { get; set; }     ........................... } 

my intention return values through webapi. return webapi, created model class containts variable want return through webapi- 'myclass'

actually, var not type, rather keyword, c# staticly typed mean compiler run on program , each var decide real type

so question, know type of data need write return type (dont lazy :))

read bit more issue here


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -