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

  • 關於本站
  • 免責聲明