.net - Using Linq to get a single column rowset from a stored procedure, How can I clean up this hack job? -
I have found a man who is a magician on writing stored procs and he does not have the time at 10 columns in one column below. I am grateful for working with them for returning XML instead of the RASK for a few days because I can cook it all day without any problem. I say that because it is a challenge to get the result of Rosette, I can easily send the line down with the WCF. Here is the hack that I have done to do this ...
public static list & lt; Int & gt; GetListOfManagersForRegional (int empId) {CMSDataContext cm = new CMSDataContext (); & Lt; CmsManagerList & gt; Mgrs = cms.GetRegionalsManagers (empId) .toList (); & Lt; Integer & gt; Managers = new list & lt; Int & gt; (); Foreach (MMM in CMMEGER MIrs) {If (M. ManagerID! = Faucet) Manager. Ed ((int) m. Manager id); } Return managers; } cmsManagerList
is a type I created in the ORM that makes the stored proc possible to return its value From which I can dig Linq. What I really want to do is go directly to the stored proc, which only list & lt; Int & gt; Returns a single column on
. Is anyone better to do this?
Try something like that:
public static IEnumerable & Lt; Int & gt; GetListOfManagersForRegional (int empId) {usage (var cms = new CMSDataContext ()) {Return from CMS. Gatoriognals Manager (empId) where m.ManagerID! = Select m.ManagerId; }}
Comments
Post a Comment