Stay organized with collections
Save and categorize content based on your preferences.
Firebase.Firestore.FirestoreEnumNameConverter< T >
Custom converter which uses enum value names instead of integer values as the Firestore representation.
Summary
This converter is not used by default; it must be configured in the same way as any other custom converter.
Currently this is always case-sensitive, with no customization of the names used. In future releases we may introduce further ways to configure this converter, but the default behavior will remain the same.
When the same enum value has multiple names, no guarantee is made about which one is returned, although both are accepted for conversion back to enum values. You are strongly encouraged not to use multiple names for the same value.
If multiple values in the enum map to the same integer, it is undefined which will be returned. If the value is not a named enum element, an exception is thrown, even if the enum is decorated with FlagsAttribute.
Details
Parameters
value
The value to convert.
Exceptions
ArgumentException
The given value is not a named value within the enum.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-06-17 UTC."],[],[],null,["Firebase.Firestore.FirestoreEnumNameConverter\\\u003c T \\\u003e\n\nCustom converter which uses enum value names instead of integer values as the [Firestore](/docs/reference/unity/namespace/firebase/firestore#namespace_firebase_1_1_firestore) representation.\n\nSummary\n\nThis converter is not used by default; it must be configured in the same way as any other custom converter.\n\nCurrently this is always case-sensitive, with no customization of the names used. In future releases we may introduce further ways to configure this converter, but the default behavior will remain the same.\n\nWhen the same enum value has multiple names, no guarantee is made about which one is returned, although both are accepted for conversion back to enum values. You are strongly encouraged not to use multiple names for the same value.\n\n\u003cbr /\u003e\n\nInheritanceInherits from: FirestoreConverter\\\u003c T \\\u003e\n\nPublic functions \n\nFromFirestore \n\n```c#\noverride T FromFirestore(\n object value\n)\n``` \n\nToFirestore \n\n```c#\noverride object ToFirestore(\n T value\n)\n``` \nConverts an enum value to its name.\n\nIf multiple values in the enum map to the same integer, it is undefined which will be returned. If the value is not a named enum element, an exception is thrown, even if the enum is decorated with FlagsAttribute.\n\n\u003cbr /\u003e"]]