首页 > 解决方案 > 无法在同一解决方案中的不同项目上在 C# 中从类转换为类

问题描述

无法从 ElasticCoreWebApi.Controllers.AcquirerController.AcquirerReportParameters 转换为 ElasticCoreWebApi.BLL.ElasticSettledTranaction.AcquirerReportParameter

ElasticCoreWebApi 有 ElasticCoreWebApi.BLL 操作的参考

ElasticCoreWebApi.AcquirerController 有类

   public class AcquiringReportParameters
        {
            public string reportname { get; set; }
            public int merchantId { get; set; }
            public string branchCodes { get; set; }
            public string fromDate { get; set; }
            public string toDate { get; set; }
            public string merchantName { get; set; }
            public string batchNo { get; set; }
            public string terminalId { get; set; }
            public string merchantNumber { get; set; }
            public string merchantBranchName { get; set; }
            public string dRCR { get; set; }
            public string mID { get; set; }
            public int pageSize { get; set; }
            public int pageIndex { get; set; }
        }

在 Acquirer 控制器中,我正在调用第二种方法并像这样传递参数,我在类中映射了数据

    AcquiringReportParameters parameters = new AcquiringReportParameters();

    ElasticSettlementTransactionBLL ElasticBLL = new ElasticSettlementTransactionBLL();
 
    *var test = await ElasticBLL.GetSettledParameterTransaction(parameters);*
*I am getting error here in the parameter*

ElasticCoreWebApi.BLL.ElasticSettledTransaction.cs 有类

  public class AcquiringReportParameters
        {
            public string reportname { get; set; }
            public int merchantId { get; set; }
            public string branchCodes { get; set; }
            public string fromDate { get; set; }
            public string toDate { get; set; }
            public string merchantName { get; set; }
            public string batchNo { get; set; }
            public string terminalId { get; set; }
            public string merchantNumber { get; set; }
            public string merchantBranchName { get; set; }
            public string dRCR { get; set; }
            public string mID { get; set; }
            public int pageSize { get; set; }
            public int pageIndex { get; set; }
        }

这是我正在调用的方法

        public async Task<string> GetSettledParameterTransaction(AcquiringReportParameters parameters)

标签: c#

解决方案


推荐阅读