Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IndexAttribute.cs
1using System;
2
4{
8 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true, Inherited = true)]
9 public class IndexAttribute : Attribute
10 {
11 private readonly string[] fieldNames;
12
18 public IndexAttribute(params string[] FieldNames)
19 {
20 if (FieldNames.Length == 0)
21 throw new ArgumentException("No field names listed.", nameof(FieldNames));
22
23 this.fieldNames = FieldNames;
24 }
25
30 public string[] FieldNames => this.fieldNames;
31 }
32}
This attribute defines a compound index for the collection holding objects of the corresponding class...
string[] FieldNames
Names of the fields to build the index on. Prefix field names with a hyphen (-) to illustrate descend...
IndexAttribute(params string[] FieldNames)
This attribute defines a compound index for the collection holding objects of the corresponding class...