Final
This commit is contained in:
@@ -5,13 +5,13 @@ namespace BibliotecaAPI.Models
|
||||
public class Libro
|
||||
{
|
||||
[Key]
|
||||
public int IdLibro { get; set; }
|
||||
public int Id_Libro { get; set; }
|
||||
public string Titulo { get; set; } = string.Empty;
|
||||
public string Autor { get; set; } = string.Empty;
|
||||
public string ISBN { get; set; } = string.Empty;
|
||||
public int Ano { get; set; }
|
||||
public string Categoria { get; set; } = string.Empty;
|
||||
public int CopiasDisponibles { get; set; }
|
||||
public int Copias_Disponibles { get; set; }
|
||||
|
||||
public ICollection<Prestamo> Prestamos {get;set;}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,19 @@ namespace BibliotecaAPI.Models
|
||||
public DateTime FechaPrestamo { get; set; } = DateTime.Now;
|
||||
public DateTime? FechaDevolucion { get; set; }
|
||||
public bool Devuelto { get; set; } = false;*/
|
||||
public int IdPrestamo { get; set; }
|
||||
public int IdUsuario { get; set; }
|
||||
public int IdLibro { get; set; }
|
||||
public DateTime FechaPrestamo { get; set; }
|
||||
public bool Devuelto {get;set;}
|
||||
[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; }
|
||||
|
||||
|
||||
public Usuario Usuario { get; set; }
|
||||
public Libro Libro { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ namespace BibliotecaAPI.Models
|
||||
public class Usuario
|
||||
{
|
||||
[Key]
|
||||
public int IdUsuario { get; set; }
|
||||
public int Id_Usuario { get; set; }
|
||||
public string Nombre { get; set; } = string.Empty;
|
||||
public string Apellido { get; set; } = string.Empty;
|
||||
public DateTime FechaRegistro { get; set; }
|
||||
public DateTime Fecha_Registro { get; set; }
|
||||
|
||||
public ICollection<Prestamo> Prestamos {get;set;}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user