Lito
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using BibliotecaAPI.Models;
|
||||
|
||||
namespace BibliotecaAPI.Data
|
||||
{
|
||||
public class BibliotecaContext : DbContext
|
||||
{
|
||||
public BibliotecaContext(DbContextOptions<BibliotecaContext> options) : base(options) { }
|
||||
|
||||
public DbSet<Libro> Libros { get; set; }
|
||||
public DbSet<Usuario> Usuarios { get; set; }
|
||||
public DbSet<Prestamo> Prestamos { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,14 @@ namespace BibliotecaAPI.Models
|
||||
public class Libro
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int IdLibro { 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 Año { get; set; }
|
||||
public int Ano { get; set; }
|
||||
public string Categoria { get; set; } = string.Empty;
|
||||
public int CopiasDisponibles { get; set; }
|
||||
|
||||
public ICollection<Prestamo> Prestamos {get;set;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace BibliotecaAPI.Models
|
||||
{
|
||||
public class Prestamo
|
||||
{
|
||||
/*
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -19,6 +20,14 @@ namespace BibliotecaAPI.Models
|
||||
|
||||
public DateTime FechaPrestamo { get; set; } = DateTime.Now;
|
||||
public DateTime? FechaDevolucion { get; set; }
|
||||
public bool Devuelto { get; set; } = false;
|
||||
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;}
|
||||
|
||||
public Usuario Usuario { get; set; }
|
||||
public Libro Libro { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@ namespace BibliotecaAPI.Models
|
||||
public class Usuario
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public int IdUsuario { get; set; }
|
||||
public string Nombre { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Apellido { get; set; } = string.Empty;
|
||||
public DateTime FechaRegistro { get; set; }
|
||||
|
||||
public ICollection<Prestamo> Prestamos {get;set;}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user