如何解决程序集引用错误。 [英] how to solve the assembly reference error.

查看:53
本文介绍了如何解决程序集引用错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HEllo团队,



我收到的错误如下:

HEllo Team,

I am getting the error as follow:

Error   2'QBPO.Application.Bpo.DataManagers.QBpoDataManager'
does not contain a definition for 'UpdateQCProcessed'
 and no extension method 'UpdateQCProcessed' accepting a first argument
of type 'QBPO.Application.Bpo.DataManagers.QBpoDataManager' could be found
 (are you missing a using directive or an assembly reference?)





因为我在.cs文件中的引用和命名空间中添加了.dll。

然后我也得到错误。亲切帮助。

请找代码

公共结果添加(IEntityBase entityBase)

{

结果结果= null;

尝试

{

IUserEntity userEntity = entityBase as IUserEntity;

Logger.Write(Inside BpoManagerWrite.Add(),LogType.Information);

QBpoDataManager bpoDataManager = new QBpoDataManager();

OcrDataManager ocrDataManager = new OcrDataManager();

result = new Result();

ICustomerLoanData customerLoanData = QBpoEntityCreator.GetCustomerLoanDataEntity();

using( TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required,CommonUtility.GetRequireTransactionOptions()))

{

if(userEntity.Role == QBPOUserRole.QbpoQcUser.ToString())

{

bpoDataManager.Update(entityBase);

bpoDataManager.UpdateQCProcessed(entityBase);

}

其他

{

////添加LoanDataTable

bpoDataManager.Add(entityBase);

////更新OCRLoan Tbl Table.Processed = 1,更新者= 1,更新日期=现在

ocrDataManager.Update(entityBase);

}

transactionScope.Complete();

}



Logger.Write(退出BpoManagerWrite.Add(),LogType.Information);

}

catch(异常异常)

{

exception.HandleException(Global.CONSTSTREXCPOLICYBUSINESS);

result.AddError(Technical发生了错误。请联系系统管理员);

}



返回结果;

}

和NameSpace是:



as i have added the .dll in references and Namespace in the .cs file.
Then also i am getting the error .Kindly help.
Pls find the code
public Result Add(IEntityBase entityBase)
{
Result result = null;
try
{
IUserEntity userEntity = entityBase as IUserEntity;
Logger.Write("Inside BpoManagerWrite.Add()", LogType.Information);
QBpoDataManager bpoDataManager = new QBpoDataManager();
OcrDataManager ocrDataManager = new OcrDataManager();
result = new Result();
ICustomerLoanData customerLoanData = QBpoEntityCreator.GetCustomerLoanDataEntity();
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, CommonUtility.GetRequireTransactionOptions()))
{
if(userEntity.Role == QBPOUserRole.QbpoQcUser.ToString())
{
bpoDataManager.Update(entityBase);
bpoDataManager.UpdateQCProcessed(entityBase);
}
else
{
////Add in LoanDataTable
bpoDataManager.Add(entityBase);
////Update in OCRLoan Tbl Table.Processed= 1, updated by =1 , updated date = Now
ocrDataManager.Update(entityBase);
}
transactionScope.Complete();
}

Logger.Write("Exiting BpoManagerWrite.Add()", LogType.Information);
}
catch (Exception exception)
{
exception.HandleException(Global.CONSTSTREXCPOLICYBUSINESS);
result.AddError("Technical Error occured. Please contact to system administrator");
}

return result;
}
and NameSpace are:

namespace QBPO.Application.Bpo.BusinessManagers
{
    using System;
    using System.Transactions;
    using QBPO.Application.Bpo.BusinessInterfaces;
    using QBPO.Application.Bpo.DataManagers;
    using QBPO.Entities.Bpo;
    using QBPO.Entities.Bpo.Entity.Interfaces;
    using QBPO.Entities.UserManagement;
    using QBPO.Framework;



}

其次,这是我调用方法的DataManagerCode


}
Secondily this is the DataManagerCode where i am calling the method

public int UpdateQCProcessed(IEntityBase entityBase)
      {
          int rowsAffected = int.MinValue;
          try
          {
              Logger.Write("Inside QBpoDataManager.UpdateQCProcessed()", LogType.Information);
              ICustomerLoanData customerLoanDataEntity = entityBase as ICustomerLoanData;
              CommonDataAccess.CreateStoredProcCommandWrapper(QBpoConstants.SPUPDATECUSTOMERLOANDATA);
              CommonDataAccess.AddInParameter(QBpoConstants.CUSTOMERLOANDATAID, DbType.Int32, customerLoanDataEntity.Id);
              CommonDataAccess.AddInParameter(QBpoConstants.UPDATEDON, DbType.DateTime, DateTime.Now.ObjectToDBDateTime());
              CommonDataAccess.AddInParameter(QBpoConstants.UPDATEDBY, DbType.Int32, customerLoanDataEntity.UpdatedBy);
              rowsAffected = CommonDataAccess.ExceuteNonQuery();
              Logger.Write("Exiting QBpoDataManager.UpdateQCProcessed()", LogType.Information);
          }
          catch (Exception exception)
          {
              throw exception;
          }

          return rowsAffected;
      }





和命名空间是:



and Namespace are:

namespace QBPO.Application.Bpo.DataManagers
{
    using System;
    using System.Data;
    using System.Text;
    using QBPO.Entities.Bpo;
    using QBPO.Entities.Bpo.Entity.Interfaces;
    using QBPO.Entities.Common;
    using QBPO.Entities.UserManagement;
    using QBPO.Framework;
    using QBPO.Framework.Application;



}


}

推荐答案

从错误结果中,您的类QBpoDataManager没有使用QBpoDataManager类型的第一个参数实现方法UpdateQCProcessed()。

所以你有两个解决方案:

1)你的QBpoDataManager类应该实现IEntityBase接口;

OR

2)使用新方法UpdateQCProcessed()扩展QBpoDataManager,该方法也接受QBpoDataManager作为参数。
From the error results that your class "QBpoDataManager" does not have implemented the method "UpdateQCProcessed()" with the first parameter of type "QBpoDataManager".
So you have two solutions:
1) Your "QBpoDataManager" class should implement the IEntityBase interface;
OR
2)Extend the QBpoDataManager with a new method "UpdateQCProcessed()"that accept also QBpoDataManager as parameter.


这篇关于如何解决程序集引用错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆