/// <inheritdoc />
        public virtual int Delete(IEnumerable <TKey> keys)
        {
            if (NextLayer == null)
            {
                throw NewException($"Default implementation of {ResourceName}->{MethodBase.GetCurrentMethod().Name} in <{GetType().FriendlyName()}> can not pass through because {nameof(NextLayer)} is null.");
            }

            return(NextLayer.Delete(keys));
        }
예제 #2
0
        /// <inheritdoc />
        public virtual int Delete(IEnumerable <TEntityKey> keys)
        {
            if (NextLayer == null)
            {
                throw NewException($"Adapter from {typeof(TEntity).FriendlyName()} to {typeof(TNextEntity).FriendlyName()} for {ResourceName}->{MethodBase.GetCurrentMethod().Name} in <{GetType().FriendlyName()}> can not pass through because {nameof(NextLayer)} is null.");
            }

            try
            { return(NextLayer.Delete(keys)); }
            catch (OcDataMappingException ex)
            { throw NewException($"Error mapping data from {typeof(TEntity).FriendlyName()} to {typeof(TNextEntity).FriendlyName()}", ex, typeof(TEntity), typeof(TNextEntity)); }
        }
예제 #3
0
        /// <inheritdoc />
        public virtual IOcApiResult <bool> Delete(TKey key)
        {
            if (NextLayer == null)
            {
                throw NewException($"Default implementation of {ResourceName}->{MethodBase.GetCurrentMethod().Name} in <{GetType().FriendlyName()}> can not pass through because {nameof(NextLayer)} is null.");
            }

            return(new OcApiResult <bool>($"{ResourceName}->{MethodBase.GetCurrentMethod().Name}", NextLayer.Delete(key), ResponseMessages));
        }