Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

I find recursion complicated recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

Edit: As a further point - it's better not to mix languages in your code: Ordnungsbegriff should be Keyword (according to Google).

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

Edit: As a further point - it's better not to mix languages in your code: Ordnungsbegriff should be Keyword (according to Google).

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

Edit: As a further point - it's better not to mix languages in your code: Ordnungsbegriff should be Keyword (according to Google).

added 138 characters in body
Source Link
RobH
  • 17.1k
  • 6
  • 38
  • 73

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

Edit: As a further point - it's better not to mix languages in your code: Ordnungsbegriff should be Keyword (according to Google).

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}

Edit: As a further point - it's better not to mix languages in your code: Ordnungsbegriff should be Keyword (according to Google).

Source Link
RobH
  • 17.1k
  • 6
  • 38
  • 73

I find recursion complicated You can use a while loop:

private string SearchDocument(Document doc)
{
 while (doc != null) 
 {
 if (!string.IsNullOrEmpty(doc.Ordnungsbegriff))
 {
 return doc.Ordnungsbegriff;
 }
 doc = doc.ParentDocument;
 }
 return null;
}
lang-cs

AltStyle によって変換されたページ (->オリジナル) /