开发者

is a 'variable' but is used like a 'method'

I attempted to search for a solution on google and on SO but was not able to resolve my issue.

My code is:

    try
    {
        objEmployerAuditReportData empAuditData = new objEmployerAuditReportData();
        IList<EmployerAuditReport> listAuditBatchList = empAuditData.GetAuditBatchList();

        foreach (var batchList in listAuditBatchList)
        {
            IList<EmployerAuditReport> listAuditBatchDetails = empAuditData.GetAuditBatchDetails(listAuditBatchList("form_request_id"));
        }

        string PDFexportFileName="";
        string PDFexportFilePath开发者_开发技巧 = System.Configuration.ConfigurationManager.AppSettings["PDFReportPath"];

    }
    catch (Exception ex)
    {
        throw ex;
    }

error message:

'listAuditBatchList' is a 'variable' but is used like a 'method'

I know this seems very simple, but I can't figure it out. Your assistance is greatly appreciated.

UPDATE:

This turned out to be an application architecture related issue. The correct solution was:

empAuditData.GetAuditBatchDetails(batchList.<propertyname>)  

and form_request_id had to be set as a property "set" and "get"


It is where you "call" listAuditBatchList with parentheses and a string argument, "form_request_id".

listAuditBatchList is a list of EmployerAuditReport, so there is no way to call it as a method, and no string keys if you meant listAuditBatchList["form_request_id"].


You have to use squre brackets([form_request_id]) instead listAuditBatchList("form_request_id").Other wise it will method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜