public static void Addtcomment(TransportatitonComment transportationComment) { using (Entities db = new Entities()) { try { db.TransportatitonComments.Add(transportationComment); db.SaveChanges(); } catch (Exception) { } } }
public static void IzbrisiTKomentar(int id) { using (Entities db = new Entities()) { TransportatitonComment komentarzabrisanje = (from a in db.TransportatitonComments where a.CommentID == id select a).Single(); try { db.TransportatitonComments.Remove(komentarzabrisanje); db.SaveChanges(); } catch (Exception) { } } }