2010-11-28 4 views
1

J'ai une procédure stockée qui retourne toujours une seule ligne
mon code ressemble actuellement quelque chose comme çaEntity Framework Résultat unique ObjectResult

public void DoSomthing() 
{ 
    ObjectResult<pDoesProductExist_Result> pDoesProductExistResults = tbsDBEntities.pDoesProductExist(itemCode); 
       foreach (pDoesProductExist_Result pDoesProductExistResult in pDoesProductExistResults) 
       { 
        return; 
       } 
... 
} 

Y at-il une meilleure façon de le faire?

Répondre

2
pDoesProductExist_Result exists = tbsDBEntities.pDoesProductExist(itemCode).Single();