public void AddCollection(workout_collection item)
 {
     try
     {
         WorkoutspaEntities1 db = new WorkoutspaEntities1();
         db.workout_collection.Add(item);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public workout_collection Find(int id)
        {
            workout_collection objWork = null;

            try
            {
                WorkoutspaEntities1 db = new WorkoutspaEntities1();
                objWork = (from obj in db.workout_collection
                           where obj.workout_id == id
                           select obj).First();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(objWork);
        }
        public void EditCollection(workout_collection item)
        {
            try
            {
                WorkoutspaEntities1 db = new WorkoutspaEntities1();
                var ObjCollection      = (from obj in db.workout_collection
                                          where obj.workout_id == item.workout_id
                                          select obj).First();

                ObjCollection.workout_title         = item.workout_title;
                ObjCollection.workout_note          = item.workout_note;
                ObjCollection.calories_burn_per_min = item.calories_burn_per_min;
                ObjCollection.category_id           = item.category_id;
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }