Fauna csharp driver  4.2.0
FaunaDB.Types.FaunaConstructorAttribute Class Reference

Instruct the decoder wich constructor to use when decoding a object. It can also be used in a public static method instead in a constructor. That attribute can only be used once per class. More...

Inheritance diagram for FaunaDB.Types.FaunaConstructorAttribute:

Detailed Description

Instruct the decoder wich constructor to use when decoding a object. It can also be used in a public static method instead in a constructor. That attribute can only be used once per class.

class Product { public string Description { get; set; } public double Price { get; set; }

[FaunaConstructor] public Product(string description, double price) { Description = description; Price = price; } }

class Order { public string Number { get; set; } public List<Product> Products { get; set; }

[FaunaConstructor] public static Order CreateOrder(string number, List<Product> products) { return new Order { Number = number, Products = products } } }

Definition at line 181 of file Attributes.cs.


The documentation for this class was generated from the following file: