예제 #1
0
        /// <summary>
        /// Deletes the row with the associated children rows.
        /// </summary>
        /// <typeparam name="T">The type of the row object.</typeparam>
        /// <param name="row">The row to delete.</param>
        /// <param name="maxLevels">Specifies the maximum number of cascading levels that can be included in the deletion. If more levels than maxLevels are needed to complete the cascade deletion, an exception is thrown.</param>
        public static Result <T> DeleteCascadeGo <T>(this T row, int maxLevels = 5)
            where T : DbRow
        {
            // check null
            if (row == null)
            {
                throw new QueryTalkException("extensions.DeleteCascadeGo<T>", QueryTalkExceptionType.ArgumentNull, "row = null", Text.Method.DeleteCascadeGo);
            }

            return(Crud.DeleteCascadeGo <T>(Assembly.GetCallingAssembly(), row, maxLevels, null));
        }
예제 #2
0
        /// <summary>
        /// Deletes the row with the associated children rows.
        /// </summary>
        /// <typeparam name="T">The type of the row object.</typeparam>
        /// <param name="row">The row to delete.</param>
        /// <param name="maxLevels">Specifies the maximum number of cascading levels that can be included in the deletion. If more levels than maxLevels are needed to complete the cascade deletion, an exception is thrown.</param>
        public static Result <T> DeleteCascadeGo <T>(T row, int maxLevels = 5)
            where T : DbRow
        {
            return(Call <Result <T> >(Assembly.GetCallingAssembly(), (ca) =>
            {
                if (row == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "row", Wall.Text.Method.DeleteCascadeGo);
                }

                return Crud.DeleteCascadeGo <T>(ca, row, maxLevels, null);
            }));
        }