Adding a Using Statement To Dispose Linq DataContext in a Compiled Query -
i using compiled queries in linq sql. pretty standard stuff this:
public static readonly func<mydatacontext,int,ienumerable<mytype>> getsomestuff = compiledquery.compile<mydatacontext,int,ienumerable<mytype>> ( (datacontext,userid) => (from u in dc.tabletype u.userid == userid select u) );
then later calling this:
using(var c = new mydatacontext()) { var qr = mycompiledqueriesclass.getsomestuff(c,12345); //etc.. }
what move using statement inside compiled query i'm stuck best way this. ideas?
Comments
Post a Comment