32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
using MieSystem.Models;
|
|
|
|
namespace MieSystem.Data
|
|
{
|
|
public static class Mapper
|
|
{
|
|
|
|
public static Expediente MapFromDictionary(IDictionary<string, object> dict)
|
|
{
|
|
return new Expediente
|
|
{
|
|
Id = Convert.ToInt32(dict["id"]),
|
|
Nombre = dict["nombre"]?.ToString(),
|
|
Apellidos = dict["apellidos"]?.ToString(),
|
|
FechaNacimiento = Convert.ToDateTime(dict["fecha_nacimiento"]),
|
|
NombrePadre = dict["nombre_padre"]?.ToString(),
|
|
NombreMadre = dict["nombre_madre"]?.ToString(),
|
|
NombreResponsable = dict["nombre_responsable"]?.ToString(),
|
|
ParentescoResponsable = dict["parentesco_responsable"]?.ToString(),
|
|
Sexo = dict["sexo"]?.ToString(),
|
|
Direccion = dict["direccion"]?.ToString(),
|
|
Telefono = dict["telefono"]?.ToString(),
|
|
Observaciones = dict["observaciones"]?.ToString(),
|
|
FotoUrl = dict["foto_url"]?.ToString(),
|
|
FechaCreacion = Convert.ToDateTime(dict["fecha_creacion"]),
|
|
FechaActualizacion = Convert.ToDateTime(dict["fecha_actualizacion"]),
|
|
Activo = Convert.ToBoolean(dict["activo"])
|
|
};
|
|
}
|
|
}
|
|
}
|