I have collection of users identified by property Id and for each user I want to update his username to something like username+"!".
In bltoolkit I try it like this:
using(var db = new DbManager)
{
foreach(var user in users)
{
db.GetTable<User>().Where(x=>x.Id == user.Id).Set(x=>x.Username, x.Username + "!").Update();
}
}
I suppose that this would make n queries to the database (while n is the size of the users collection), which is what I am trying to avoid.
Is there any other (better) solution to update whole collection like this?