IEnumerable as Out Parameter [Resolved]

Posted by Sharpcnet under LINQ on 11/16/2013 | Points: 10 | Views : 3095 | Status : [Member] | Replies : 1
I'm trying to write a method, that would give, top 10 records and also total no. of records, from the table.
public void GetData(out IEnumerable<tblCountry> iList, out int rowCount)
{
iList = DBContext.tblCountries.Where(c=>c.Id > 0).Take(10);
rowCount = DBContext.tblCountries.Where(c=>c.Id > 0).Count();
}
But,I am unable to figure out how to call this function and access the output parameters
objDAL.GetData(//what should come here, out int rcount);
Is there a better approach.
using c#, entity framework




Responses

Posted by: Allemahesh on: 11/18/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
You can try this below one:-

IEnumerable<tblCountry> iList;
int rowCount;
objDAL.GetData(out iList, out rowCount);



Happy Coding,
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response