efcore
efcore copied to clipboard
Allow to configure a property as non-persisted only for sproc mapping
Is there a way to use InsertUsingStoredProcedure and UpdateUsingStoredProcedure with the same entity and configure it so that I can ignore a property on Update that is not used. Our example is using a CreatedDateTime and LastModifiedTime where both are used in the Insert procedure but then CreatedDateTime is not passed into the update procedure and we would like to ignore it for that case.
This depends on https://github.com/dotnet/efcore/issues/14121 Related to https://github.com/dotnet/efcore/issues/28436
@AndriySvyryd Is there any way to work around this issue, so we could ignore a field, when using InsertUsingStoredProcedure? Maybe it's sufficient in a first step to remove the validation, which requires all fields to be defined as a Parameter, because this clearly doesn't hold for any entity with computed fields.
@bytefish No, I can't think of a way around this currently, apart from adding a dummy parameter to the sproc.
@AndriySvyryd Thanks for the confirmation and thanks for your work on EF Core! 👍🏻