/// <summary> /// Borrows a book by a reader /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='readerID'> /// the reader ID /// </param> /// <param name='bookID'> /// the book ID /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> PostAsync(this IBorrowedBooks operations, int readerID, int bookID, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PostWithHttpMessagesAsync(readerID, bookID, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Borrows a book by a reader /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='readerID'> /// the reader ID /// </param> /// <param name='bookID'> /// the book ID /// </param> public static object Post(this IBorrowedBooks operations, int readerID, int bookID) { return(Task.Factory.StartNew(s => ((IBorrowedBooks)s).PostAsync(readerID, bookID), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }