Exemplo n.º 1
0
        protected int ExecuteNoneQuery()
        {
            try
            {
                int resultAffected = CurrentCommand.ExecuteNonQuery();
                if (UseCaching && !String.IsNullOrEmpty(CRUDTableName) &&
                    (CurrentCommand.CommandText.ToLower().EndsWith("insert") ||
                     CurrentCommand.CommandText.ToLower().EndsWith("update") ||
                     CurrentCommand.CommandText.ToLower().EndsWith("delete")))
                {
                    ClearCg(CRUDTableName.GetHashCode().ToString());
                }

                return(resultAffected);
            }
            catch (Exception ex)
            {
                throw new ManagedException(ex.Message, false);
            }
        }