protected virtual void VisitCollection(HadithCollection collection)
        {
            var groupedHadiths = collection.Hadiths
                                 .GroupBy(x => x.PrimaryReference[0]);

            VisitHadithGroups(groupedHadiths);
        }
Exemple #2
0
        public Hadith(
            HadithCollection collection,
            IEnumerable <HadithReference> references,
            IEnumerable <string> arabicText,
            IEnumerable <string> englishText,
            IEnumerable <VerseRangeReference> verseReferences)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }
            if (references == null || !references.Any())
            {
                throw new ArgumentNullException(nameof(references));
            }
            if (arabicText == null)
            {
                throw new ArgumentNullException(nameof(arabicText));
            }
            if (englishText == null)
            {
                throw new ArgumentNullException(nameof(englishText));
            }
            if (verseReferences == null)
            {
                throw new ArgumentNullException(nameof(verseReferences));
            }

            this.Collection      = collection;
            this.References      = references.ToArray();
            this.ArabicText      = arabicText.ToArray();
            this.EnglishText     = englishText.ToArray();
            this.VerseReferences = verseReferences.Distinct().OrderBy(x => x).ToArray();
            ReferencesByCode     = references.ToDictionary(x => x.Code, StringComparer.InvariantCultureIgnoreCase);
            PrimaryReference     = GetReference(collection.PrimaryReferenceDefinition.Code) ?? References.First();
        }
Exemple #3
0
 public void AddCollection(HadithCollection collection)
 {
     this._Collections.Add(collection.Code, collection);
 }
 public CollectionAndHadith(HadithCollection collection, Hadith hadith)
 {
     this.Collection = collection;
     this.Hadith     = hadith;
 }