POST api/Leitores

Adiciona um novo leitor ao banco de dados.

Request Information

URI Parameters

None.

Body Parameters

Objeto contendo os dados do novo leitor a ser criado.

Leitor
NameDescriptionTypeAdditional information
Id

integer

None.

Nome

string

None.

Apelido

string

None.

Email

string

None.

Contacto

string

None.

TipoLeitor

string

None.

Bloqueado

boolean

None.

Emprestimos

Collection of Emprestimo

None.

Reservas

Collection of Reserva

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "Nome": "sample string 2",
  "Apelido": "sample string 3",
  "Email": "sample string 4",
  "Contacto": "sample string 5",
  "TipoLeitor": "sample string 6",
  "Bloqueado": true,
  "Emprestimos": [
    {
      "Id": 1,
      "IdLeitor": 1,
      "DataEmprestimo": "2026-08-26T09:12:30.8216967-05:00",
      "DataDevolucao": "2026-08-26T09:12:30.8216967-05:00",
      "PrazoDevolucao": "2026-08-26T09:12:30.8216967-05:00",
      "Devolvido": true,
      "MultaPaga": true,
      "EmprestimoLivros": [
        {
          "IdEmprestimo": 1,
          "IdLivro": 1,
          "Livro": {
            "Id": 1,
            "Titulo": "sample string 2",
            "Autor": "sample string 3",
            "Editora": "sample string 4",
            "AnoPublicacao": 5,
            "QtdDisponivel": 6,
            "IdCategoria": 1,
            "EmprestimoLivros": [],
            "ReservaLivros": [
              {
                "IdReserva": 1,
                "IdLivro": 1,
                "Reserva": {
                  "Id": 1,
                  "IdLeitor": 1,
                  "DataReserva": "2026-08-26T09:12:30.8216967-05:00",
                  "DataExpiracao": "2026-08-26T09:12:30.8216967-05:00",
                  "Ativa": true,
                  "ReservaLivros": []
                }
              }
            ],
            "Categoria": {
              "Id": 1,
              "Nome": "sample string 2",
              "Livros": []
            }
          }
        }
      ]
    }
  ],
  "Reservas": [
    {
      "Id": 1,
      "IdLeitor": 1,
      "DataReserva": "2026-08-26T09:12:30.8216967-05:00",
      "DataExpiracao": "2026-08-26T09:12:30.8216967-05:00",
      "Ativa": true,
      "ReservaLivros": [
        {
          "IdReserva": 1,
          "IdLivro": 1,
          "Livro": {
            "Id": 1,
            "Titulo": "sample string 2",
            "Autor": "sample string 3",
            "Editora": "sample string 4",
            "AnoPublicacao": 5,
            "QtdDisponivel": 6,
            "IdCategoria": 1,
            "EmprestimoLivros": [
              {
                "IdEmprestimo": 1,
                "IdLivro": 1,
                "Emprestimo": {
                  "Id": 1,
                  "IdLeitor": 1,
                  "DataEmprestimo": "2026-08-26T09:12:30.8216967-05:00",
                  "DataDevolucao": "2026-08-26T09:12:30.8216967-05:00",
                  "PrazoDevolucao": "2026-08-26T09:12:30.8216967-05:00",
                  "Devolvido": true,
                  "MultaPaga": true,
                  "EmprestimoLivros": []
                }
              }
            ],
            "ReservaLivros": [],
            "Categoria": {
              "Id": 1,
              "Nome": "sample string 2",
              "Livros": []
            }
          }
        }
      ]
    }
  ]
}

application/xml

Sample:

Sample not available.

text/xml

Sample:

Sample not available.

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

Resultado da operação.

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.