Exemplo n.º 1
0
 public static void AssertForeignKeyExists(string input, string key, GTFSCalendarCollection collection, string collectionName)
 {
     if (input == null)
     {
         throw new PropertyNullException(key);
     }
     if (!collection.Contains(input))
     {
         if (input == "")
         {
             throw new PropertyNullException(key);
         }
         else
         {
             throw new PropertyForeignKeyException(key, $"The collection {collectionName} doesn't contain the key {input}.");
         }
     }
 }