Primera subida
This commit is contained in:
7
back/Entities/BaseEntity.cs
Normal file
7
back/Entities/BaseEntity.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace back.Entities
|
||||
{
|
||||
public class BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
17
back/Entities/Casa.cs
Normal file
17
back/Entities/Casa.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace back.Entities
|
||||
{
|
||||
public class Casa : BaseEntity
|
||||
{
|
||||
public string NombreCasa { get; set; } = string.Empty;
|
||||
public int NumeroHabitaciones { get; set; }
|
||||
|
||||
public int PersonaId { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual Persona Persona { get; set; }
|
||||
public int DireccionId { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual Direccion Direccion { get; set; }
|
||||
}
|
||||
}
|
||||
10
back/Entities/DTOs/Request/CasaRequestDto.cs
Normal file
10
back/Entities/DTOs/Request/CasaRequestDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class CasaRequestDto
|
||||
{
|
||||
public int PersonaId { get; set; }
|
||||
public string NombreCasa { get; set; } = string.Empty;
|
||||
public int NumeroHabitaciones { get; set; }
|
||||
public DireccionRequestDto? Direction { get; set; }
|
||||
}
|
||||
}
|
||||
10
back/Entities/DTOs/Request/CasaUpdateRequestDto.cs
Normal file
10
back/Entities/DTOs/Request/CasaUpdateRequestDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class CasaUpdateRequestDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string NombreCasa { get; set; } = string.Empty;
|
||||
public int NumeroHabitaciones { get; set; }
|
||||
public DireccionUpdateRequestDto? Direccion { get; set; }
|
||||
}
|
||||
}
|
||||
10
back/Entities/DTOs/Request/CasaWitDirecctionRequestDto.cs
Normal file
10
back/Entities/DTOs/Request/CasaWitDirecctionRequestDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class CasaWitDirecctionRequestDto
|
||||
{
|
||||
public string NombreCasa { get; set; } = string.Empty;
|
||||
public int NumeroHabitaciones { get; set; }
|
||||
public DireccionRequestDto Direction { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
8
back/Entities/DTOs/Request/DireccionRequestDto.cs
Normal file
8
back/Entities/DTOs/Request/DireccionRequestDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class DireccionRequestDto
|
||||
{
|
||||
public string Calle { get; set; } = string.Empty;
|
||||
public int? Numero { get; set; }
|
||||
}
|
||||
}
|
||||
9
back/Entities/DTOs/Request/DireccionUpdateRequestDto.cs
Normal file
9
back/Entities/DTOs/Request/DireccionUpdateRequestDto.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class DireccionUpdateRequestDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Calle { get; set; } = string.Empty;
|
||||
public int? Numero { get; set; }
|
||||
}
|
||||
}
|
||||
8
back/Entities/DTOs/Request/PersonaRequestDto.cs
Normal file
8
back/Entities/DTOs/Request/PersonaRequestDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class PersonaRequestDto
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
9
back/Entities/DTOs/Request/PersonaUpdateRequestDto.cs
Normal file
9
back/Entities/DTOs/Request/PersonaUpdateRequestDto.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace back.Entities.DTOs.Request
|
||||
{
|
||||
public class PersonaUpdateRequestDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
9
back/Entities/DTOs/Response/IWantItAll.cs
Normal file
9
back/Entities/DTOs/Response/IWantItAll.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace back.Entities.DTOs.Response
|
||||
{
|
||||
public class IWantItAll
|
||||
{
|
||||
public List<Persona> Personas { get; set; }
|
||||
public List<Casa> Casas { get; set; }
|
||||
public List<Direccion> Direcciones { get; set; }
|
||||
}
|
||||
}
|
||||
8
back/Entities/Direccion.cs
Normal file
8
back/Entities/Direccion.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace back.Entities
|
||||
{
|
||||
public class Direccion : BaseEntity
|
||||
{
|
||||
public string Calle { get; set; } = string.Empty;
|
||||
public int? Numero { get; set; }
|
||||
}
|
||||
}
|
||||
13
back/Entities/Persona.cs
Normal file
13
back/Entities/Persona.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace back.Entities
|
||||
{
|
||||
public class Persona : BaseEntity
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Surname { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<Casa>? Casas { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user