I was wondering if there is a smarter/faster/one_line way to approach this.
I have a list of dll's with IsActive
property. On the UI I have checkboxes which change state of dll's depending on whether the checkbox is checked or not. Change happens on button click. I have no problem traversing the whole DB so now I am doing it like this:
foreach (var item in dllList)
{
context.dllSet.Find(item.Id).IsActive = item.IsActive;
}
(dllList
is List<>
element connected to WPF front).
So now I am finding element with same id in DB, and changing its state to one that is in presented in UI checkbox.
Solution I'd like would be something like this:
context.dllSet.AddOrUpdateList(dllList);