I have the following query
var listOfFollowers = (from a in db.UserLinks
where a.TargetUserID == TargetUserID && a.LinkStatusTypeID == 2
join b in db.UserNotifications on (int)a.OriginUserID equals b.TargetUserID
select b);
then I want to update once column on each row ( or object) returned
foreach (var a in listOfFollowers)
{
a.UserNotifications += HappeningID.ToString() + "|";
}
db.SubmitChanges();
The query seems to work , and when I put the generated SQL into SSMS it works fine , but when I run the entire code I get exception for trying to cast to int, don't make too much sense.
Is this ok , to do a query using a join , but only returning one table , change one property, then submitchanges?