Пример #1
0
        public bool DeleteCrust(Crust crust)
        {
            if (db.Crusts.Where(c => c == crust).Count() != 0)
            {
                var entry = db.Entry <Crust>(crust);

                entry.State = EntityState.Deleted;
            }

            return(db.SaveChanges() > 0);
        }
Пример #2
0
        public bool ChangeCrust(Crust crust)
        {
            if (db.Crusts.Where(c => c.CrustId == crust.CrustId).Count() != 0)
            {
                var entry = db.Entry <Crust>(crust);

                entry.State = EntityState.Modified;
            }

            return(db.SaveChanges() > 0);
        }
Пример #3
0
        public bool InsertCrust(Crust newCrust)
        {
            db.Crusts.Add(newCrust);

            return(db.SaveChanges() > 0);
        }