Ex : I have Two Collections like List
Integration above Collection and make a List
For this I am using Foreach and form the collection ,
But I need Linq Query to make the same scenario.
Can any one give me Idea on above Query?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Oct 19, 2011, 12:35 AM EDT
Jean PaulRank #32 · 38.5K reputationPosted Oct 13, 2011, 12:11 AM EDT
I can provide a solution in which the above typed lists are casted to object.
(I believe the classes Registration and Patient are deriving from ServiceDetails)
If the classes are not having base as ServiceDetail, you may declare an implicit operator overloading like..
(but not sure it will fit the above code)
Regards,
JP
VulpesRank #55 · 29.2K reputationPosted Oct 13, 2011, 1:05 AM EDT
Pulagara Murali40 reputationPosted Oct 18, 2011, 11:28 PM EDT
I have a Collection like ServiceDetails. It Contains
Patient Object and Registration Object
ServiceDetail serviceDetail=new ServiceDetail ();
serviceDetail.Patient=new Patient();
serviceDetail.Registration=new Registration();
ServiceDetails(serviceDetail);
Above Is my Objct Formation.
In this case I have Two Other Collections Like 'Patients' and 'Registrations'
For above Object formation I wrote like below
List
foreach(ServiceDetail serviceItem in ServiceDetails)
{
//Bind Patient Object
serviceItem.Patient=Patients.where(i=>i.patientid==serviceItem.patientid)
.firstorDefault();
//Bind Registration Object
serviceItem.Registration=Registrations.where(i=>i.registrationId==serviceItem.registrationid)
.firstorDefault();
serviceDetails.add(serviceItem);
}
ServiceDetails=new List
For above collection formation I used one foreach. My query is I don,t used even one foreach also to make a Collection, instead of foreach I want to use Lamda expression or Linq Query .
Could you give any Idea on this Query Please?
Pulagara Murali40 reputationPosted Oct 18, 2011, 11:31 PM EDT
Pulagara Murali40 reputationPosted Dec 2, 2011, 7:52 PM EST
I have one more query , how to pass parameters from Silverlight to Asp.net(without querystring and Initparameters)?
Could you give me any Idea?
VulpesRank #55 · 29.2K reputationPosted Dec 3, 2011, 3:49 AM EST
Please start a new thread if you want to ask a new question.
You'll have a better chance of getting a reply :)