无法隐式转换类型bool [英] Cannot implicitly convert type bool

查看:465
本文介绍了无法隐式转换类型bool的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个代码,我在Catch块中收到错误,声明无法将类型bool隐式转换为kCura.EventHandler.Response。以下是我的代码:



Hi,

I have a code where i am getting error in Catch block stating "cannot implicitly convert type bool to kCura.EventHandler.Response". Below is my code:

DTOs.RDO TR = new DTOs.RDO(this.ActiveArtifact.ParentArtifactID.Value);
TR.ArtifactTypeGuids = new List<guid>()
{
    GuidCollection.Task;
};

try
{
    Output = proxy.Repositroies.RDO.Read(TR);
}
catch(Exception ex)
{
    Utils.WrteToLog(ex.Message);
    return false;
}



我知道整个属于特定的API,但错误接近返回false说明无法将类型bool隐式转换为kCura.EventHandler.Response 。所以我想知道它究竟意味着什么以及需要采取什么行动。任何帮助将不胜感激。



我尝试过:



我尝试在谷歌搜索,并了解这是一些转换问题但未能实现并解决此问题。


I know the whole belongs to the particular API, but the error is near return false stating "cannot implicitly convert type bool to kCura.EventHandler.Response". So i want to what exactly it means and what action need to be taken. Any help would be appreciated.

What I have tried:

I tried searching in google and understood that it is some conversion issue but failed to implement and resolve this.

推荐答案

错误消息是明确的:该方法应该返回一个对象,当它返回 false 时, kCura.EventHandler.Response 的类型是布尔值。你应该返回正确的(失败的) Response 对象。
The error message is clear: the method is supposed to return an object having kCura.EventHandler.Response type while it is returning false which is a boolean. You should return the proper (failure) Response object.


这篇关于无法隐式转换类型bool的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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