c# - How return Tuple<T1,T2> -


i create method anonymous types. want return tuple. how implement this?

public ienumerable<tuple<t1, t2, t3>> getfiles() {     using (testentities context = new testentities())     {         var query = pf in context.t1                     join pfext in context.t2 on pf.id equals pfext.processedfilesid                     join st in context.t3 on pfext.wfstatusid equals st.wfstatusid                     select new                     {                         pf.id,                                                       pf.recordcount,                         pf.name,                         pfext.packageid,                         statusname = st.name,                         pfext.protocolstatus                     };     }            } 

something following should work:

public ienumerable<tuple<t1, t2, t3>> getfiles() {     using (testentities context = new testentities())     {         var query = pf in context.t1                     join pfext in context.t2 on pf.id equals pfext.processedfilesid                     join st in context.t3 on pfext.wfstatusid equals st.wfstatusid                     select new { pf, pfext, st };         return query.asenumerable()                     .select(x => tuple.create(x.pf, x.pfext, x.st));     }            } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -