Hi,
is there a way how I could tell the serializer to output number for a
Nullable<Enum>?
Cheers?
On 3 Jan., 09:39, Demis Bellot <
demis.bel...@gmail.com> wrote:
> Your current options are:
>
> - Convert it to a string (and therefore serialize it as you want)
> - Create a duplicate set of enums without the flag attribute (i.e.
> specific for a DTO)
> - Embed it in a type and customize the De/Serialization with
> JsConfig<T>.SerializeFn, e.g:
>
>
https://github.com/ServiceStack/ServiceStack.Text/blob/master/src/Ser...
>
https://github.com/ServiceStack/ServiceStack.Text/blob/master/src/Ser...
>
> Cheers,
>
> On Tue, Jan 3, 2012 at 3:22 AM, Corneliu I. Tusnea <
corne...@onesaas.com>wrote:
>
>
>
>
>
>
>
>
>
> > Can I "convince" it to serialize Flags as strings?
>
> > "Value1 | Value2 | Value3" ?
>
> > Kind Regards,
> > Corneliu
>
> > Corneliu I. Tusnea
> > OneSaas - Cloud Integrations Made Easy
> >
www.OneSaas.com
> > Phone US/International: *+1 800 255 OneSaas*
(+1 800 255 6637)
> > Phone AU: *1300 OneSaas* (1300 663 7227)
> > On Tue, Jan 3, 2012 at 5:29 AM, Demis Bellot <
demis.bel...@gmail.com>wrote:
>
> >> Enums with the [Flags] attribute get serialized as numbers, Enums without
> >> the attribute are serialized as strings.
>
> >> On Mon, Jan 2, 2012 at 6:57 AM, Corneliu I. Tusnea <
corne...@onesaas.com>wrote:
>
> >>> Hi,
>
> >>> I'd like to customize my JSON serialization out of a service to export
> >>> the Enums as string values versus the integer number.
>
> >>> Is this possible?
>
> >>> Kind Regards,
> >>> Corneliu
>
> >>> Corneliu I. Tusnea
> >>> OneSaas - Cloud Integrations Made Easy
> >>>
www.OneSaas.com
> >>> Phone US/International: *+1 800 255 OneSaas*
(+1 800 255 6637)
> >>> Phone AU: *1300 OneSaas* (1300 663 7227)