Пример #1
0
        /// <inheritdoc />
        public bool DeleteToggleMark(TKey id, bool delete)
        {
            IBaseCustomizeEntity domainEntity = Get(id)
                                                as IBaseCustomizeEntity;

            if (domainEntity != null)
            {
                domainEntity.IsRemoved = delete;
                return(delete);
            }

            throw new CustomException(string.Format(Messages.Exception_EntityNotFoundTemplate, string.Empty, id));
        }
Пример #2
0
        /// <inheritdoc />
        public async Task <bool> DeleteToggleMarkAsync(TKey id, bool delete)
        {
            IBaseCustomizeEntity domainEntity = (await GetAsync(id))
                                                as IBaseCustomizeEntity;

            if (domainEntity != null)
            {
                domainEntity.IsRemoved = delete;
                await SaveChangesAsync();

                return(delete);
            }

            throw new CustomException(string.Format(Messages.Exception_EntityNotFoundTemplate, string.Empty, id));
        }