3层业务到演示层错误 [英] 3 Tier Layer Business to Presenation Layer Error

查看:58
本文介绍了3层业务到演示层错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一家公司表示层.我正在尝试从表示层访问业务层中的方法.

I have a Business & Presentation Layer. I am trying to access a method in the Business Layer from the Presentation Layer.

// Presentation Layer Code
Grade grd = new Grade();
grd = Businesslayer.GetGradeID((int)gradeId);



等级是Class& GetGradeID是BusinessLayer中的方法.

我得到的错误是<<不能隐式将类型BusinessLayer.Grade转换为PresentationLayer.Grade>>< br/>
请提供任何帮助.



Grade is a Class & GetGradeID is the method in the BusinessLayer.

Error I am getting is <<Cannot Implicitly convert type BusinessLayer.Grade to PresentationLayer.Grade>>

Any help please.

推荐答案



我说对了吗,您是从您的Businesslayer中检索的吗?
这个成绩列表?
如果我是对的,那么表示层上的声明应为:


Hi,

Do I am right to say that from your Businesslayer you are retrieving
this list of Grade?
If I am right the Declaration on Presentation Layer should be:


var  grd = Businesslayer.GetGradeID((int)gradeId);



grd 示例内容成绩
列表
希望这可以帮助...

如果有帮助,请记住标记为有帮助....

问候,
Algem



grd example contents List of Grade

Hope this could help...

Remember to mark as helpful if it help....

Regards,
Algem


Algem.

你对我的理解是正确的.但是,即时通讯与普通的桌面应用程序一起使用c#,所以我将var更改为Object,并且工作得很好.

问候
Hi Algem.

You understood me correctly. However, im using c# with a normal desktop application so i changed the var to an Object and worked perfectly fine.

Regards


这篇关于3层业务到演示层错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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