Exemple #1
0
        public void Insert(AutorBE autor)
        {
            Autor a = new Autor
            {
                Nombres = autor.Nombres,
                Activo  = "01"
            };

            context.Autor.Add(a);
            context.SaveChanges();
        }
Exemple #2
0
        public void Update(AutorBE autor)
        {
            Autor a = new Autor
            {
                IdAutor = autor.IdAutor,
                Nombres = autor.Nombres,
                Activo  = "01"
            };

            context.Entry(a).State = EntityState.Modified;
            context.SaveChanges();
        }
Exemple #3
0
        public AutorBE Find(int id)
        {
            AutorBE autor = new AutorBE();
            Autor   a     = context.Autor.Find(id);

            if (a != null)
            {
                autor = new AutorBE
                {
                    IdAutor = a.IdAutor,
                    Nombres = a.Nombres,
                    Activo  = a.Activo
                };
            }
            return(autor);
        }
Exemple #4
0
 // PUT: api/Autor/5
 public void Put(int id, AutorBE autor)
 {
     autor.IdAutor = id;
     manager.Update(autor);
 }
Exemple #5
0
 // POST: api/Autor
 public void Post(AutorBE autor)
 {
     manager.Insert(autor);
 }