EFCore.BulkExtensions icon indicating copy to clipboard operation
EFCore.BulkExtensions copied to clipboard

BulkRead: only read certain properties

Open SIT-jekleine opened this issue 4 years ago • 6 comments

Is it possible to to only read cetain properties with the BulkRead function? I am trying to find a solution to load a single property based on the Id of the entity.

SIT-jekleine avatar Jul 13 '21 09:07 SIT-jekleine

You can use PropertiesToInclude or PropertiesToExclude, more info in ReadMe.

borisdj avatar Jul 13 '21 09:07 borisdj

You can use PropertiesToInclude or PropertiesToExclude, more info in ReadMe.

That is indeed what I was trying to do without any success. The function call: image

And the actual sql query being executed where AddressableId shouldn't be included: image

I am using version 3.6.1 of EFCore.BulkExtensions

SIT-jekleine avatar Jul 13 '21 10:07 SIT-jekleine

You are correct, only in memory excluded are skipped but from Db it selects all. Will consider if this could be improved.

borisdj avatar Jul 13 '21 11:07 borisdj

Would also love this, useful to reload ids only.

sommmen avatar Jan 05 '22 11:01 sommmen

You are correct, only in memory excluded are skipped but from Db it selects all. Will consider if this could be improved.

Perhaps you could give me a quick description of what'd need to be done? I might take a peek if its not too complicated and i have some spare time during the weekends.

sommmen avatar Jan 05 '22 11:01 sommmen

Is there a chance it was working in version 3.1?

oresttkachukd avatar Feb 02 '22 12:02 oresttkachukd