Exemplo n.º 1
0
        private void InnerAdd <TFact>(TFact fact, IEqualityComparer <IFact> comparer) where TFact : IFact
        {
            IFactType factType = fact.GetFactType();

            if (ContainerList.Contains(fact, comparer))
            {
                throw CommonHelper.CreateException(ErrorCode.InvalidData, $"The fact container already contains '{factType.FactName}' fact.");
            }

            ContainerList.Add(fact);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public virtual bool Contains <TFact>(TFact fact) where TFact : IFact
        {
            IFactType factType = fact.GetFactType();

            return(ContainerList.Contains(fact, GetEqualityComparer()));
        }