blairacuda
Technical User
i am just getting into the Entity Framework stuff of 4.0 and i'm running into a little issue that is driving me crazy.
Here's my code:
var partTypeGUIDQuery = from p in ecEntities.Parts where p.PartID == pGUID select p.PartTypeID;
foreach (Guid g in ((ObjectQuery)partTypeGUIDQuery).Execute(MergeOption.AppendOnly))
{
partTypeGUID= g;
}
basically my question is that if i know i'm only going to get one result from the ObjectQuery what should i do instead of the foreach. everything i've tried hasn't worked and its annoying me to foreach on each of my object queries.
thanks in advance
CBlair
Crystal, InstallShield, branching out in other programming realms.
Here's my code:
var partTypeGUIDQuery = from p in ecEntities.Parts where p.PartID == pGUID select p.PartTypeID;
foreach (Guid g in ((ObjectQuery)partTypeGUIDQuery).Execute(MergeOption.AppendOnly))
{
partTypeGUID= g;
}
basically my question is that if i know i'm only going to get one result from the ObjectQuery what should i do instead of the foreach. everything i've tried hasn't worked and its annoying me to foreach on each of my object queries.
thanks in advance
CBlair
Crystal, InstallShield, branching out in other programming realms.