コード例 #1
0
        public string CheckBookStatus(string title)
        {
            var status = BibliothecaClient.ExecuteGet <BookStatus?>($"books/{title}/check");

            if (status.HasValue)
            {
                if (status.Value == BookStatus.Available)
                {
                    return("Book is available for the taking");
                }
                else
                {
                    return("Book is already taken");
                }
            }
            else
            {
                return("Book not found");
            }
        }
コード例 #2
0
 public Book[] GetTakenBooks(int id)
 {
     return(BibliothecaClient.ExecuteGet <Book[]>($"accounts/{id}/books"));
 }
コード例 #3
0
 public Account GetAccount(int id)
 {
     return(BibliothecaClient.ExecuteGet <Account>($"accounts/{id}"));
 }
コード例 #4
0
 public Account[] GetAccounts()
 {
     return(BibliothecaClient.ExecuteGet <Account[]>("accounts"));
 }
コード例 #5
0
 public Book GetBook(int id)
 {
     return(BibliothecaClient.ExecuteGet <Book>($"books/{id}"));
 }
コード例 #6
0
 public Book[] GetBooks()
 {
     return(BibliothecaClient.ExecuteGet <Book[]>("books"));
 }