Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dictionary method which loops and add the documents. All I want now is to reference this method to another method in the same class and be able to access the parameter.

<pre>How to call Dictionary class into another class and reference its parameter


What I have tried:

  //I want to be able to do this from this class
  var file = DocumentsToPDFDocs(financialDocument);
  
  --
  
  --

}


//This is the Dictionary class
public Dictionary<FinancialDocument, PdfDocument> DocumentsToPDFDocs(IEnumerable<FinancialDocument> financialDocuments)
        {
            var ret = new Dictionary<FinancialDocument, PdfDocument>();
            foreach (var finDoc in financialDocuments)
            {
                ret.Add(finDoc, new PdfDocument(new PdfReader(finDoc.Document)));
            }
            return ret;
        }
Posted
Updated 17-Jan-20 1:37am
Comments
Richard Deeming 17-Jan-20 7:39am    
Not clear. Are you asking how to call a method in C#? You already know how to do that - you're doing it in the method you've shown.

Click the green "Improve question" link and update your question with a clear description of what you're trying to do, what you've tried, and where you're stuck.

1 solution

Do you mean this:
C#
var file = DocumentsToPDFDocs(financialDocument);
foreach (FinancialDocument fd in file.Keys)
   {
   PdfDocument pd = file[fd];
   ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900