You want it like this
(int?)(from ur in db.User_Ratings
where ur.UserId == employer.UserId
select (int)ur.Rating).Average() ?? 0
You can't use null coalescing if it is not checking for null objects. Average returns an int and it can't do ?? against it. You tried putting the (int?) in the select that's fine if you want and then it does the average which might return again an int and not a nullable one.