back soft

مطالب مرتبط با «best performance for cs go» در back soft | نویسنده: استخدام کار

Best performance for find objects in entities and load entities, Foreach or where with LinQ ON C#?

Vote count: 0 I need to relate a few entities. Right now the code is loaded the first entity and then is iterated with a foreach loop and search on each record if the current row match with the property of the record of the other entity. Something like: foreach (Entity1 e1 in entity1List) { foreach (Entity2 e2 in entity2List) { if (e2.Id == e1.Id) { //Do something } } } But the entities have a lot of records and the performance is not being good. I want to improve the speed trying to use linQ for search the record. var list = entity2List.Where(e2 => entity1.Any(e1 => e1.Id == e2.Id)); foreach (Entity2 e2 in list ) { //Do something } But I don't know if this is really helping for the performa...

ادامه مطلب

برچسب‌های مرتبط

best performance for price car | best performance for overwatch | best performance for windows 10 | best performance for price gpu | best performance for price cpu | best performance for the money car | best performance for price laptop | best performance for windows 7 | best performance for fallout 4 | best performance for cs go