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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -