40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
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;*/
|
|
[Key]
|
|
public int Id_Prestamo { get; set; }
|
|
[ForeignKey(nameof(Libro))]
|
|
public int Id_Libro { get; set; } // FK
|
|
//public Libro Libro { get; set; } // Propiedad de navegación
|
|
|
|
[ForeignKey(nameof(Usuario))]
|
|
public int Id_Usuario { get; set; } // FK
|
|
//public Usuario Usuario { get; set; } // Propiedad de navegación
|
|
|
|
public DateTime Fecha_Prestamo { get; set; }
|
|
public bool Devuelto { get; set; }
|
|
|
|
|
|
}
|
|
}
|