coronabytes / dotnet-arangodb

.NET Driver for ArangoDB
Apache License 2.0
66 stars 18 forks source link

How to avoid the save of a property of the model class? #26

Closed isaacfi closed 3 years ago

isaacfi commented 3 years ago

Hi,

Is there any way to avoid the save of a property in a document? For example:

public class User{
  public string userId { get; set; }
  public string name { get; set; }
  public string lastName { get; set; }
  // And If I don't want to store this property. What can I do?
  public string lastName { get { return $"{name} {lastName}"; }}
}

BR.

coronabytes commented 3 years ago

[JsonIgnore] from Newtonsoft or System.Text.Json depending on the serializer

or

[ArangoIgnore] with Newtonsoft only / this deserializes from arango but does not serialize writing

coronabytes commented 3 years ago

readme