Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem with C# 3.0 Collection and Object Initializers Pin
Gareth H13-May-08 9:06
Gareth H13-May-08 9:06 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
User 665813-May-08 9:13
User 665813-May-08 9:13 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
Gareth H13-May-08 9:36
Gareth H13-May-08 9:36 
AnswerRe: Problem with C# 3.0 Collection and Object Initializers Pin
Ed.Poore13-May-08 10:20
Ed.Poore13-May-08 10:20 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
User 665813-May-08 10:39
User 665813-May-08 10:39 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
Ed.Poore13-May-08 11:14
Ed.Poore13-May-08 11:14 
QuestionHelp can't find how retrieve element in a list!! Pin
papy-boom13-May-08 5:34
papy-boom13-May-08 5:34 
AnswerRe: Help can't find how retrieve element in a list!! Pin
User 665813-May-08 7:41
User 665813-May-08 7:41 
You got two minor errors:

List<article> ListResult = ListArticle.FindAll(delegate(Article art)
{
   for (int i = 0; i < art.Component<code>s</code>.Count; i++)
   {
      return art.Component<code>s</code>[i].Quantity.Equals(20);
   }

  <code>return false;</code> // Otherwise "not all code paths return a value
});</article>


1) Components instead of Component, because that's how the property is called in your Article definition
2) your delegate must return something in case there are no Components in the list, otherwise you get the "not all code paths return a value" compiler error

regards

modified 12-Sep-18 21:01pm.

AnswerRe: Help can't find how retrieve element in a list!! Pin
Christian Graus13-May-08 13:22
protectorChristian Graus13-May-08 13:22 
GeneralRe: Help can't find how retrieve element in a list!! Pin
papy-boom13-May-08 22:35
papy-boom13-May-08 22:35 
QuestionEnsure a parameter is not null Pin
-Dy13-May-08 5:20
-Dy13-May-08 5:20 
GeneralRe: Ensure a parameter is not null Pin
CPallini13-May-08 5:43
mveCPallini13-May-08 5:43 
AnswerRe: Ensure a parameter is not null Pin
User 665813-May-08 7:25
User 665813-May-08 7:25 
AnswerRe: Ensure a parameter is not null Pin
Dave Sexton13-May-08 10:43
Dave Sexton13-May-08 10:43 
GeneralRe: Ensure a parameter is not null Pin
Vikram A Punathambekar13-May-08 19:06
Vikram A Punathambekar13-May-08 19:06 
AnswerRe: Ensure a parameter is not null Pin
Christian Graus13-May-08 11:45
protectorChristian Graus13-May-08 11:45 
GeneralRe: Ensure a parameter is not null Pin
Malcolm Smart13-May-08 12:35
Malcolm Smart13-May-08 12:35 
GeneralRe: Ensure a parameter is not null Pin
Christian Graus13-May-08 13:23
protectorChristian Graus13-May-08 13:23 
GeneralRe: Ensure a parameter is not null Pin
S. Senthil Kumar13-May-08 17:36
S. Senthil Kumar13-May-08 17:36 
GeneralRe: Ensure a parameter is not null Pin
Vikram A Punathambekar13-May-08 19:08
Vikram A Punathambekar13-May-08 19:08 
GeneralRe: Ensure a parameter is not null Pin
Malcolm Smart13-May-08 21:24
Malcolm Smart13-May-08 21:24 
GeneralRe: Ensure a parameter is not null Pin
S. Senthil Kumar13-May-08 22:38
S. Senthil Kumar13-May-08 22:38 
GeneralRe: Ensure a parameter is not null Pin
Vikram A Punathambekar13-May-08 19:12
Vikram A Punathambekar13-May-08 19:12 
AnswerRe: Ensure a parameter is not null Pin
PIEBALDconsult13-May-08 13:23
mvePIEBALDconsult13-May-08 13:23 
QuestionApp.Config Sharing (sort of) Pin
#realJSOP13-May-08 5:17
mve#realJSOP13-May-08 5:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.