Breeze / breeze.server.net

Breeze support for .NET servers
MIT License
76 stars 62 forks source link

[NotMapped] properties are returned when querying the entity #124

Closed graphicsxp closed 1 year ago

graphicsxp commented 3 years ago

We have a bunch of [NotMapped] properties in our C# model. They are not part of the metadata returned by the server.

However, when querying these entities (by id for instance), the data payload returned to the client does contain these unmapped properties.

Is this an expected behavior ?

We are using breeze.server .net core 3

steveschmitt commented 1 year ago

The [NotMapped] attribute indicates that the C# property will not be mapped to a field in the database table. But it does not affect the JSON serialization of the property.

If you want to prevent the property from being serialized and sent to the client, use the [JsonIgnore] or [IgnoreDataMember] attribute.