logo
  • 教程列表
  • SO官方文档
  • 诊断断言
    • 参数检查
    • 确保项目处于编辑模式
    • 确保两个值相等
    • 确保值为 true 或 false
    • ResultNotNull
    • 必需对象
    • NullEmpty 检查
    • 安全断言
  1. StackOverflow 文档
  2. sitecore 教程
  3. 诊断断言
  4. ResultNotNull

ResultNotNull

Created: November-22, 2018

ResultNotNull() 检查传入的对象是否为空。如果对象和消息不为 null,则它将简单地返回传入的对象,否则将抛出 InvalidOperationException。

return Assert.ResultNotNull(this.Database.GetItem(this.ItemRootId), string.Concat("Root item not found. ID: ", this.ItemRootId));
  • 必需对象
  • 确保值为 true 或 false

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明