Esempio n. 1
0
        public static DVDIcon UpdateDVDIcon(MyDVDsContext context, DVDIcon newdvi)
        {
            var olddvi = GetDVDIcon(context, newdvi.Id);

            context.Entry(olddvi).CurrentValues.SetValues(newdvi);
            context.SaveChanges();

            newdvi = GetDVDIcon(context, newdvi.Id);

            return(newdvi);
        }
Esempio n. 2
0
        public static Rating UpdateRating(MyDVDsContext context, Rating newrating)
        {
            var oldrating = GetRating(context, newrating.Id);

            context.Entry(oldrating).CurrentValues.SetValues(newrating);
            context.SaveChanges();

            newrating = GetRating(context, newrating.Id);

            return(newrating);
        }
Esempio n. 3
0
        public static Genre UpdateGenre(MyDVDsContext context, Genre newgenre)
        {
            var oldgenre = GetGenre(context, newgenre.Id);

            context.Entry(oldgenre).CurrentValues.SetValues(newgenre);
            context.SaveChanges();

            newgenre = GetGenre(context, newgenre.Id);

            return(newgenre);
        }
Esempio n. 4
0
 public static int DeleteRating(MyDVDsContext context, Rating Rtg)
 {
     context.Entry(Rtg).State = EntityState.Deleted;
     return(context.SaveChanges());
 }
Esempio n. 5
0
 public static int DeleteGenre(MyDVDsContext context, Genre gnr)
 {
     context.Entry(gnr).State = EntityState.Deleted;
     return(context.SaveChanges());
 }