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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -