private static bool CheckWordLength(WordPairDto wordPair) { const int minimumWordLength = 2; const int maximumWordLength = 10; var isWordLengthSatisfied = wordPair.Arabic.Length > minimumWordLength && wordPair.English.Length > minimumWordLength && wordPair.Arabic.Length < maximumWordLength && wordPair.English.Length < maximumWordLength; return(isWordLengthSatisfied); }
private static bool CheckIfWordpairIsInCollection(VocabularyCollectionDto vocabularies, WordPairDto wordPair) { var isNewWordInCollection = vocabularies.English.All(v => v.Word != wordPair.English) || vocabularies.Arabic.All(v => v.Word != wordPair.Arabic); return(isNewWordInCollection); }