Пример #1
0
        // TODO: Consider if ContentSpecs are equal even if Constraint doesn't matches, but Content matches.
        // As we only want a single entry even when Constraints differ, one might lean towards only checking the Content object??
        // If we keep the current implementation then:
        // - We can have the same Content multiple times processed
        // - JSON.NET does not properly detect self referencing problems

        // TODO: This would also be a problem for Entity Framework, etc, or not?
        public bool Equals(ContentSpec <T> other) => other?.GetHashCode() == GetHashCode();
Пример #2
0
 public void Replace(ContentSpec existing, Content n)
 {
     Contents.Remove(existing);
     Contents.Add(new ContentSpec(n, existing.Constraint));
 }