Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit 99c97e2

Browse files
committed
Update README.md
1 parent 9b1eaf6 commit 99c97e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
ServiceStack.Text.EnumMemberSerializer
22
======================================
33

4-
Extension for ServiceStack.Text to allow using EnumMember attributes to serialize and deserialize enumerations. This allows you to use more human readable values while still leveraging the benefits of using enumerations.
4+
Extension for [`ServiceStack.Text`](https://github.com/ServiceStack/ServiceStack.Text) to allow using [`EnumMemberAttribute`](http://msdn.microsoft.com/en-us/library/system.runtime.serialization.enummemberattribute.aspx) to serialize and deserialize enumerations. This allows you to use more human readable values while still leveraging the benefits of using enumerations.
5+
6+
Custom enumeration serialization currently only applies to the json serializer. It works by assigning custom delegates to [`JsConfig<T>.SerializeFn`](https://github.com/ServiceStack/ServiceStack.Text/blob/master/src/ServiceStack.Text/JsConfig.cs) and [`JsConfig<T>.DeSerializeFn`](https://github.com/ServiceStack/ServiceStack.Text/blob/master/src/ServiceStack.Text/JsConfig.cs).
57

68
#Example Configuration
79

@@ -94,6 +96,12 @@ Without ServiceStack.Text.EnumMemberSerializer:
9496
}
9597
]
9698
```
99+
#Considerations
100+
* Only configures public enumerations.
101+
* `.WithNamespaceFilter()` only applies to filtering public enums found in the assemblies passed in using `.WithAssemblies()`. Any enumerations explicitly identified `.WithEnumTypes()` will not be filtered by namespace. The namespace filter applies to all provided assemblies.
102+
* Multiple calls to `.WithEnumTypes()` and `.WithNamespaceFilter()` will be added and not replace previous specified values.
103+
* This manipulates the static `JsConfig<T>`. Other code called later may overwrite the custom serialization/deserialization delegates.
104+
* Both `.WithEnumTypes()` and `.WithAssemblies()` may be used at the same time, the results will be combined.
97105

98106
#Using the Code
99107

0 commit comments

Comments
 (0)