Ejemplo n.º 1
0
 public Persona(Persona personaCopia) : base(personaCopia.Nombre)
 {
     this.email    = personaCopia.email;
     this.anio     = personaCopia.anio;
     this.nacional = personaCopia.nacional;
     this.genero   = personaCopia.genero;
 }
Ejemplo n.º 2
0
 private IEnumerable <LivroApi> ListaDoTipo(TipoGenero tipo)
 {
     return(_repo.All
            .Where(l => l.Genero == tipo)
            .Select(l => l.ToApi())
            .ToList());
 }
Ejemplo n.º 3
0
 public Persona(string nom, string email, int anio, TipoGenero genero, bool nacional = true)
     : base(nom)
 {
     // base.Nombre = nom;
     this.Email    = email;
     this.Nacional = nacional;
     this.Anio     = anio;
     this.Genero   = genero;
 }
 //Precio Maximo y Precio Minimo se van a preguntar de forma consecutiva
 public PerfilStub(TipoGenero genero, TipoGeneraciones edad, List <string> intereses, int precioMin, int PrecioMax)
 {
     this.Genero = genero;
     this.Edad   = edad;
     foreach (string interes in intereses)
     {
         this.AddInteres(interes);
     }
     this.PrecioMin = precioMin;
     this.PrecioMin = PrecioMax;
 }
 private ListaLivraria CriaLista(TipoGenero tipo)
 {
     return(new ListaLivraria
     {
         Tipo = tipo.ParaString(),
         Livros = _repo.All
                  .Where(l => l.Genero == tipo)
                  .Select(l => l.ToApi())
                  .ToList()
     });
 }
        // Constructor

        /// <summary>
        /// Crea un objeto Profesor a partir de sus datos (si son correctos).
        /// </summary>
        /// <param name="nombre">Nombre del profesor.</param>
        /// <param name="dni">DNI del profesor.</param>
        /// <param name="genero">Género del profesor (hombre/mujer)</param>
        public Profesor(string nombre, string dni, TipoGenero genero)
        {
            if (nombre != "")
            {
                this.nombre = nombre;
            }
            else
            {
                throw new Exception("El nombre del profesor no puede estar vacío.");
            }

            if (dni.Length == 9)
            {
                this.dni = dni;
            }
            else
            {
                throw new Exception("El DNI debe tener 9 caracteres.");
            }

            this.genero = genero;
        }
Ejemplo n.º 7
0
 public static string ParaString(this TipoGenero tipo)
 {
     return(mapa.First(s => s.Value == tipo).Key);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Fija el tipo de género del Perfil
 /// </summary>
 /// <param name="idPerfil">Número identificador del Perfil</param>
 /// <param name="genero">Valor nuevo del género</param>
 public static void SetGenero(long idPerfil, TipoGenero genero)
 {
     BibliotecaPerfiles.GetUsuario(idPerfil).Genero = genero;
 }
        public IActionResult Recuperar(TipoGenero tipo)
        {
            var lista = CriaLista(tipo);

            return(Ok(lista));
        }
Ejemplo n.º 10
0
 public bool Delete(TipoGenero entity)
 {
     _context.TipoGeneros.Remove(entity);
     return(Save());
 }
Ejemplo n.º 11
0
 public bool Update(TipoGenero entity)
 {
     _context.TipoGeneros.Update(entity);
     return(Save());
 }
Ejemplo n.º 12
0
 public bool Create(TipoGenero entity)
 {
     _context.TipoGeneros.Add(entity);
     return(Save());
 }