efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Support non-persisted properties

Open AndriySvyryd opened this issue 7 years ago • 5 comments

Add a way to ignore a property for updates or queries, this is useful when the property value is always computed on the client, see https://github.com/aspnet/EntityFrameworkCore/issues/10768 Cosmos would use this to store the client key for entities in owned collections.

This would replace the relational IReadOnlyProperty.*IsStored methods

It could be configured separetely for different mapping types (Table, View, Sproc, etc.)

AndriySvyryd avatar Dec 07 '18 23:12 AndriySvyryd

@AndriySvyryd PropertySaveBehavior?

ajcvickers avatar Dec 11 '18 00:12 ajcvickers

@ajcvickers Are you suggesting to add another value, like IgnoreForQueryToo? That would be one way of implementing this.

AndriySvyryd avatar Dec 11 '18 00:12 AndriySvyryd

@AndriySvyryd Not really suggesting anything, just wondering how close it is to what we need.

ajcvickers avatar Dec 11 '18 00:12 ajcvickers

@ajcvickers PropertySaveBehavior currently only affects the update pipeline, we still need something for query, so I guess it's halfway there.

AndriySvyryd avatar Dec 11 '18 00:12 AndriySvyryd

1e6d85e02d3d1a58b58261bbbfae56dc5bbcf6e1 implemented this in Cosmos by allowing to set "PropertyName" to an empty string.

AndriySvyryd avatar Dec 18 '18 21:12 AndriySvyryd