判断IEnumerable<T>集合中是否包含有T对象

比如,有角色集合中,只有用户创建有角色,才出现“分配”铵钮。反之,隐藏。

IEnumerable有一个方法,叫Any:

原文地址:https://www.cnblogs.com/insus/p/6164188.html