예제 #1
0
 public T saveUpdate(T entry)
 {
     try
     {
         using (var context = new DBBitzenContext())
         {
             context.Add(entry);
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         //generate log
     }
     return(entry);
 }
예제 #2
0
        public bool delete(T entry)
        {
            bool result = true;

            try
            {
                using (var context = new DBBitzenContext())
                {
                    context.Remove(entry);
                    context.SaveChanges();
                }
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }