This is what I have and it keeps returning null.
It doesn\'t recognize the Convert.toInt32 when I add a where statement
var maxTopID = (from max in
How about converting the TopicID in SELECT and use String.IsNullOrEmpty() to remove empty string, like:
TopicID
SELECT
String.IsNullOrEmpty()
var maxTopID = (from max in dbcontext.Topics.Local where !String.IsNullOrEmpty(max.TopicID) select Convert.ToInt32(max.TopicID)).Max();
See the Demo