I have the following code. I'm getting error:
The cast to value type 'System.Int32' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.
var MaxValue = (from t in context.ppatalukmasters where t.regioncode == model.regioncode select t.talukcode).Max();
How can i modify?