public static void Addtrating(TransportatitonRating transportationRating) { using (Entities db = new Entities()) { try { db.TransportatitonRatings.Add(transportationRating); db.SaveChanges(); } catch (Exception) { } } }
public static void IzbrisiTRating(int id) { using (Entities db = new Entities()) { TransportatitonRating komentarzabrisanje = (from a in db.TransportatitonRatings where a.RatingID == id select a).Single(); try { db.TransportatitonRatings.Remove(komentarzabrisanje); db.SaveChanges(); } catch (Exception) { } } }