private static IEnumerable <VerseRangeReference> AddSurroundingVerses(int?context, VerseRangeReference firstReference) { IEnumerable <VerseRangeReference> verseRangeReferences; int numberOfVerses = QuranStructure.Chapter(firstReference.Chapter).NumberOfVerses; int firstVerse = Math.Max(1, firstReference.FirstVerse - context.Value); int lastVerse = Math.Min(numberOfVerses, firstReference.LastVerse + context.Value); var newVerseReference = new VerseRangeReference( chapter: firstReference.Chapter, firstVerse: firstVerse, lastVerse: lastVerse); verseRangeReferences = new[] { newVerseReference }; return(verseRangeReferences); }
public Chapter Get(int chapterNumber) => QuranStructure.Chapter(chapterNumber);