我有这样的结构。如何从泛型返回对象的bool值
public class ExportStructure
{
public string issueid { get; set; }
public string filename {get;set;}
public bool export { get; set; }
}
public class ExportStructureManager
{
public List<ExportStructure> ExportIntoStructure { get; set; }
public ExportStructureManager()
{
this.ExportIntoStructure = new List<ExportStructure>();
}
public ExportStructure AddToStructure(string issueid,string filename,bool exportornot)
{
ExportStructure expstr = new ExportStructure();
expstr.issueid = issueid;
expstr.filename = filename;
expstr.export = exportornot;
this.ExportIntoStructure.Add(expstr);
return (expstr);
}
public bool GetStatusFromStructure(string issuekey)
{
return (from p in ExportIntoStructure
where p.issueid == issuekey
select p.export));
}
}
从上面的一个,我想执行GetStatusFromStructure
这样,它应该回到我的export
财产状况。对于那个我这样写的。但它给错误的
无法隐式转换类型“System.Collections.Generic.IEnumerable”到“布尔”
在select p.export
如何解决这个问题?
不应该是'where p.issueid == issuekey' – 2012-08-03 11:34:25