Last post Sep 24, 2014 02:35 AM by Mikesdotnetting
Sep 22, 2014 06:29 PM|ivan.petrovic|LINK
I have query which retrieve list of key value pairs. Key is type "long" and value is type "string". Key is always same, and I use this as PersonID. So, I want to retrieve one PersonID as OUTPUT parameter and List collection which belong to that PersonID.
I can do it by grouping all results for that PersonID. But is it possible to use output parameter and store PersonID and also return List collection?
Something like this:
return (from p in _context.Persons
where p => p.EntityID == entityID
select personID = p.PersonID // Output parameter
I expect as return value only List, and I want PersonID as output parameter.
Sep 24, 2014 02:35 AM|Mikesdotnetting|LINK
LINQ doesn't know anything about output parameters. The only way you can do this is if you create a stored procedure and call that using LINQ. My preference would be for grouping.