The problem is that you are trying to use an Int64 value in a place that takes an int/Int32 . There is no implicit conversion, and therefore no compiler errors.
The best way to fix this is to convert the aliases dictionary to use the Int64 type. It is always safe to convert int to Int64 , so there is no loss of information in this conversion.
Ideally, you convert GetUrlAliasesByType to return an IDictionary<Int64,string> . The rest of the system now uses Int64 , so this conversion makes sense. Otherwise, you can do the following
string alias; try { if (aliases.TryGetValue(checked((int)recipe.Id), out alias)) { recipe.QuickLink = alias; } } catch (OverflowException) {
A proven operation is necessary here because it prevents inactive overflow from creating a false match using TryGetValue
source share