Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-dotnet.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
Maps a property/field member constructor parameter to FaunaDB object property while encoding/deconding an object. If this attribute if not specified the property/field name constructor parameter name will be used instead. More...
Public Member Functions | |
FaunaFieldAttribute (string name) | |
Properties | |
string | Name [get] |
The name of the property when encoding/decoding objects. More... | |
object | DefaultValue [get, set] |
The default value used for a missing property when decoding an object. More... | |
Maps a property/field member constructor parameter to FaunaDB object property while encoding/deconding an object. If this attribute if not specified the property/field name constructor parameter name will be used instead.
class Car { [FaunaField("model")] public string Model { get; set; }
[FaunaField("manufacturer")] public string Manufacturer { get; set; } }
var car = new Car { Model = "DeLorean DMC-12", Manufacturer = "DeLorean Motor Company" };
var encoded = Encoder.Encode(car);
//encoded will be equivalent to:
ObjectV.With("model", "DeLorean DMC-12", "manufacturer", "DeLorean Motor Company")
class Product { private string description; private double price;
[FaunaConstructor] public Product([FaunaField("Description")] string description, [FaunaField("Price")] double price) { this.description = description; this.price = price; } }
Definition at line 41 of file Attributes.cs.
FaunaDB.Types.FaunaFieldAttribute.FaunaFieldAttribute | ( | string | name | ) |
Definition at line 53 of file Attributes.cs.
|
getset |
The default value used for a missing property when decoding an object.
Definition at line 51 of file Attributes.cs.
|
get |
The name of the property when encoding/decoding objects.
Definition at line 46 of file Attributes.cs.