Thinktecture.EntityFrameworkCore icon indicating copy to clipboard operation
Thinktecture.EntityFrameworkCore copied to clipboard

Unable to exclude shadow properties from bulk updates

Open kev24uk opened this issue 1 year ago • 1 comments
trafficstars

Hello, I have been using the BulkInsertOrUpdateAsync method on a project and for the most part it works great!

I have come across one snag however where I have a shadow property on my entity (which is actually an identity property and therefore cannot be inserted or updated).

Since the IEntityPropertiesProvider.Exclude<T> method takes in a projection, I could not find a way to provide a shadow property which doesn't exist on the entity class to the exclude.

Is there a way around this or could this be added?

Thanks!

kev24uk avatar Sep 12 '24 16:09 kev24uk

Hi, you can implement IEntityPropertiesProvider to get full control over what properties should be inserted/updated. The class ExcludingEntityPropertiesProvider would be a good starting point.

PawelGerr avatar Sep 14 '24 08:09 PawelGerr