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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -