Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/marchena96/Paradigma-lab1/llms.txt

Use this file to discover all available pages before exploring further.

Performs a full update on an existing Library record. The controller first verifies the library exists using libraryId; if it does not, it returns 404. When the library is found, LibrariesService.Update replaces the Name and Location fields on the tracked entity and persists the changes to the database. The id in the request body is used by EF Core to locate the database row to update.

Endpoint

PUT /api/libraries/{libraryId}

Authentication

No authentication is required. The Update action does not carry an [Authorize] attribute.

Path Parameters

libraryId
integer
required
The unique integer ID of the library to update. The controller performs an existence check against this value before applying any changes.

Request Body

Send a JSON object with the following fields. The Content-Type header must be application/json.
id
integer
The ID of the library. This should match the libraryId path parameter. Used by LibrariesService.Update to locate the record in the database.
name
string
The new name for the library. Replaces the existing Name field.
location
string
The new location for the library. Replaces the existing Location field.

Response

204 No Content

Returned when the update is applied successfully. The response body is empty.

404 Not Found

Returned when no library with the given libraryId exists. No update is performed. The response body is empty.

Status Codes

StatusMeaning
204No Content — the library was updated successfully.
404Not Found — no library with the given libraryId was found.

What Gets Updated

LibrariesService.Update fetches the tracked entity and explicitly sets only two fields:
projectForChanges.Name     = library.Name;
projectForChanges.Location = library.Location;
Only Name and Location are overwritten. The Id (primary key) is never changed.

Example Request

curl -X PUT https://localhost:7098/api/libraries/5 \
  -H "Content-Type: application/json" \
  -d '{
    "id": 5,
    "name": "Updated Library Name",
    "location": "500 Main St, Springfield, IL 62701, USA"
  }'

Example Response

A 204 No Content response has no body. A successful update looks like this at the HTTP level:
HTTP/1.1 204 No Content

Build docs developers (and LLMs) love