Generic Database Linq -


Looking at the function given below, I can take a table from my database and where the extension method and beautiful a simple wrapper By using the method and supplying a filter, all other cases are created. Public Zero Received People (expression & lieutenant; function and lieutenant; TbPopaulal, ball> gt; & gt; filter, action & lt; list & lt; tblPeople & gt; & gt; callback) People in var query = sdContext.tblPeople . ) Select people; Var DSQuery = (Data service service & lt; tblPeople & gt;) query; DSQuery.BeginExecute (result => {callback (DSQuery.EndExecute (results). List list & lt; tblPeople & gt; ());}, tap); }

What I would really like to do now is to write a more general method, which exits tblPeople for a parameter, in this way I have just one line for all my calls I can find methods, at least this list provides! {Var query = Choose sdContext.T.Where (filter) DB from DD; Var DSQuery = (Data service service & lt; T & gt;) query; DSQuery.BeginExecute (Results => {Callback (DSQuery.EndExecute (Results) for list. & Lt; T & gt; ())}}, Faucet); }

Is it possible!

This can work .. (Vbquery = db to sdContext.GetTable & lt.)

  Public zero getTable & lt; T & gt; (Expression & lt; funk & lt; t, bool & gt; filter, action & lt; list & lt; T & gt;; t & gt; where (filter) choose db; var dsquery = (data Service service & lt; T & gt;) query; DSQuery.BeginExecute (result => {callback (DSQuery.EndExecute (results) for list  ());}, tap); }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -