簡體   English   中英

錯誤並非所有代碼路徑都返回值。 為什么?

[英]Error not all code paths return a value. why?

public static trnUser GetUserByEmail(string email)
{
    if (string.IsNullOrEmpty(email) == true)
    {
        return null;
    }
}
if (string.IsNullOrEmpty(email) == true) {
      return null;
} else {
      return new trnUser();
}

您需要提供有關if語句為false時返回什么的信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM