public void Post(solucione sol) { if (ModelState.IsValid) { myEntity.soluciones.Add(sol); myEntity.SaveChanges(); } }
public void Put(solucione sol) { if (ModelState.IsValid) { myEntity.Entry(sol).State = EntityState.Modified; try { myEntity.SaveChanges(); } catch (Exception) { throw; } } }
public void Delete(int id) { solucione dlt = myEntity.soluciones.Find(id); if (dlt != null) { try { myEntity.soluciones.Remove(dlt); myEntity.SaveChanges(); } catch (Exception) { throw; } } }
public solucione Get(int id) { solucione sol = myEntity.soluciones.Find(id); return(sol); }