private static void ValidWriteResult(GetLastErrorResult result) { if (!result.Ok && result.HasLastErrorMessage) { throw new ProviderException(result.LastErrorMessage); } }
public MongoDbException(string message, GetLastErrorResult result, Exception innerException) : base(message, innerException) { if (result == null) { throw new ArgumentNullException("result"); } this.Result = result; }
public static async Task <bool> VerifyReturnMessage(GetLastErrorResult writeConcernResult) { return(await Task.Factory.StartNew(() => { if (writeConcernResult == null) { return false; } if (string.IsNullOrEmpty(writeConcernResult.LastErrorMessage)) { return true; } return false; })); }