除非纯粹的类型检查,否则使用as转换比is快
is and as// is 转换
is and as
object obj = GetReferent();
is and as
if (obj is SomeType)
}

相关文章:

  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-01-13
  • 2021-12-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案