Пример #1
0
        /// <summary>
        ///     Saves changes in context (SaveChanges) and, if there is an open transaction, commits as well.
        /// </summary>
        /// <returns>True if there was any entity changed or false if there wasn't</returns>
        public bool Commit()
        {
            if (_context.SaveChanges() <= 0)
            {
                return(false);
            }

            _dbContextTransaction?.Commit();
            return(true);
        }
Пример #2
0
 public virtual int SaveChanges()
 {
     return(Context.SaveChanges());
 }