Reputation: 1666
I have a stored procedure which always returns a single row
Currently my code looks something like this
public void DoSomthing()
{
ObjectResult<pDoesProductExist_Result> pDoesProductExistResults = tbsDBEntities.pDoesProductExist(itemCode);
foreach (pDoesProductExist_Result pDoesProductExistResult in pDoesProductExistResults)
{
return;
}
...
}
Is there a better way of doing this?
Upvotes: 1
Views: 2949
Reputation: 61477
pDoesProductExist_Result exists = tbsDBEntities.pDoesProductExist(itemCode).Single();
Upvotes: 2