Ejemplo n.º 1
0
 public void Post(solucione sol)
 {
     if (ModelState.IsValid)
     {
         myEntity.soluciones.Add(sol);
         myEntity.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void Put(solucione sol)
 {
     if (ModelState.IsValid)
     {
         myEntity.Entry(sol).State = EntityState.Modified;
         try
         {
             myEntity.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Ejemplo n.º 3
0
        public void Delete(int id)
        {
            solucione dlt = myEntity.soluciones.Find(id);

            if (dlt != null)
            {
                try
                {
                    myEntity.soluciones.Remove(dlt);
                    myEntity.SaveChanges();
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
Ejemplo n.º 4
0
        public solucione Get(int id)
        {
            solucione sol = myEntity.soluciones.Find(id);

            return(sol);
        }