MODELS AND CONTROLLERS

This commit is contained in:
MARIFER HERNANDEZ GONZALEZ
2025-10-28 19:40:21 -06:00
parent 7b037ee769
commit e873c3f903
14 changed files with 279 additions and 32 deletions

24
Models/Prestamo.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BibliotecaAPI.Models
{
public class Prestamo
{
[Key]
public int Id { get; set; }
[ForeignKey("Usuario")]
public int UsuarioId { get; set; }
public Usuario? Usuario { get; set; }
[ForeignKey("Libro")]
public int LibroId { get; set; }
public Libro? Libro { get; set; }
public DateTime FechaPrestamo { get; set; } = DateTime.Now;
public DateTime? FechaDevolucion { get; set; }
public bool Devuelto { get; set; } = false;
}
}