コード例 #1
0
 /// <summary>
 /// Gets result by cody
 /// </summary>
 /// <param name="code">Result code</param>
 /// <param name="message">Message</param>
 /// <returns>Return data access event result</returns>
 public static DataAccessEventExecuteResult CodeResult(DataAccessEventResultCode code, string message = "")
 {
     if (string.IsNullOrWhiteSpace(message))
     {
         message = code.ToString();
     }
     var success = GetSuccessByCode(code);
     return new DataAccessEventExecuteResult()
     {
         Code = ((int)code).ToString(),
         Message = message,
         Success = success
     };
 }
コード例 #2
0
 /// <summary>
 /// Gets success by code
 /// </summary>
 /// <param name="code">Code</param>
 /// <returns>Return whether success by code</returns>
 static bool GetSuccessByCode(DataAccessEventResultCode code)
 {
     return code == DataAccessEventResultCode.Success;
 }