无法从'bool'转换为'System.Func< bool>' [英] cannot convert from 'bool' to 'System.Func<bool>'

查看:181
本文介绍了无法从'bool'转换为'System.Func< bool>'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IsPrime返回bool。



任务< bool> t1 =  new 任务< bool>(IsPrime(numberBeingTested)); 

解决方案

< BLOCKQUOTE>任务< BOOL> t1 =新任务< bool>(()=> IsPrime(numberBeingTested));


IsPrime returns bool.

Task<bool> t1 = new Task<bool>(IsPrime(numberBeingTested));

解决方案

Task<bool> t1 = new Task<bool>(() => IsPrime(numberBeingTested));


这篇关于无法从'bool'转换为'System.Func&lt; bool&gt;'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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