public static void AddReferencedIds(this NamedContentData source, IField field, HashSet <DomainId> result, int referencesPerField = int.MaxValue)
        {
            Guard.NotNull(field, nameof(field));

            var extractor = new ReferencesExtractor(result, referencesPerField);

            AddReferencedIds(source, field, extractor);
        }
        public static void AddReferencedIds(this NamedContentData source, IEnumerable <IField> fields, HashSet <Guid> result, int referencesPerField = int.MaxValue)
        {
            Guard.NotNull(fields);

            var extractor = new ReferencesExtractor(result, referencesPerField);

            AddReferencedIds(source, fields, extractor);
        }
Example #3
0
        public static void AddReferencedIds(this NamedContentData source, IField field, HashSet <Guid> result)
        {
            Guard.NotNull(field);

            var extractor = new ReferencesExtractor(result);

            AddReferencedIds(source, field, extractor);
        }
        public static void AddReferencedIds(this NamedContentData source, Schema schema, HashSet <Guid> result, int referencesPerField = int.MaxValue)
        {
            Guard.NotNull(schema);

            var extractor = new ReferencesExtractor(result, referencesPerField);

            AddReferencedIds(source, schema.Fields, extractor);
        }
Example #5
0
 private static void AddReferencedIds(ContentData source, HashSet <DomainId> result, int referencesPerField, IField field)
 {
     if (source.TryGetValue(field.Name, out var fieldData) && fieldData != null)
     {
         foreach (var partitionValue in fieldData)
         {
             ReferencesExtractor.Extract(field, partitionValue.Value, result, referencesPerField);
         }
     }
 }
        public static HashSet <DomainId> GetReferencedIds(this NamedContentData source, Schema schema, int referencesPerField = int.MaxValue)
        {
            Guard.NotNull(schema, nameof(schema));

            var extractor = new ReferencesExtractor(new HashSet <DomainId>(), referencesPerField);

            AddReferencedIds(source, schema.Fields, extractor);

            return(extractor.Result);
        }
Example #7
0
        public static HashSet <Guid> GetReferencedIds(this NamedContentData source, Schema schema)
        {
            Guard.NotNull(schema);

            var extractor = new ReferencesExtractor(new HashSet <Guid>());

            AddReferencedIds(source, schema.Fields, extractor);

            return(extractor.Result);
        }
Example #8
0
        public static HashSet <DomainId> GetReferencedIds(this IField field, IJsonValue?value, int referencesPerField = int.MaxValue)
        {
            var result = new HashSet <DomainId>();

            if (value != null)
            {
                ReferencesExtractor.Extract(field, value, result, referencesPerField);
            }

            return(result);
        }
        private static void AddReferencedIds(NamedContentData source, IField field, ReferencesExtractor extractor)
        {
            if (source.TryGetValue(field.Name, out var fieldData) && fieldData != null)
            {
                foreach (var partitionValue in fieldData)
                {
                    extractor.SetValue(partitionValue.Value);

                    field.Accept(extractor);
                }
            }
        }
Example #10
0
        public static void AddReferencedIds(this ContentData source, IField field, HashSet <DomainId> result, int referencesPerField = int.MaxValue)
        {
            Guard.NotNull(field, nameof(field));
            Guard.NotNull(result, nameof(result));

            if (source.TryGetValue(field.Name, out var fieldData) && fieldData != null)
            {
                foreach (var partitionValue in fieldData)
                {
                    ReferencesExtractor.Extract(field, partitionValue.Value, result, referencesPerField);
                }
            }
        }
        public static HashSet <DomainId> GetReferencedIds(this IField field, IJsonValue?value, int referencesPerField = int.MaxValue)
        {
            var result = new HashSet <DomainId>();

            if (value != null)
            {
                var extractor = new ReferencesExtractor(result, referencesPerField);

                extractor.SetValue(value);

                field.Accept(extractor);
            }

            return(result);
        }
Example #12
0
        public static HashSet <Guid> GetReferencedIds(this IField field, IJsonValue?value)
        {
            var result = new HashSet <Guid>();

            if (value != null)
            {
                var extractor = new ReferencesExtractor(result);

                extractor.SetValue(value);

                field.Accept(extractor);
            }

            return(result);
        }
 private static void AddReferencedIds(NamedContentData source, IEnumerable <IField> fields, ReferencesExtractor extractor)
 {
     foreach (var field in fields)
     {
         AddReferencedIds(source, field, extractor);
     }
 }
Example #14
0
 public static IEnumerable <Guid> GetReferencedIds(this IField field, IJsonValue value, Ids strategy = Ids.All)
 {
     return(ReferencesExtractor.ExtractReferences(field, value, strategy));
 }
Example #15
0
 public static IEnumerable <Guid> ExtractReferences(this IField field, IJsonValue value)
 {
     return(ReferencesExtractor.ExtractReferences(field, value));
 }