linq find by id code example
Example 1: linq where id in list
var result = _dataContext.table.Where(x => idList.Contains(x.Id));
Example 2: linq find object from id
MyObject myObject = collectionMyObject.FirstOrDefault(o => o.Items != null && o.Items.Any(io => io.Id == 2));