Ejemplo n.º 1
0
        public void Delete(I id)
        {
            T itemToDelete;

            try
            {
                validate.ValidateIdNull(id, "Delete");
                if (FindItem(id, out itemToDelete))
                {
                    RemoveItem(itemToDelete);
                    logger.LogInfo($"Item Id = {id} removed from items collection");
                }
                else
                {
                    validate.IdDoesntExist(id, "Delete", items);
                }
            }
            catch (Exception e)
            {
                logger.LogError(e);
                throw;
            }
        }