Test

<back to all web services

TestDataAllCollectionTypes

The following routes are available for this service:
All Verbs/testdata/AllCollectionTypes
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Test.ServiceInterface;
using Test.ServiceModel.Types;

namespace Test.ServiceInterface
{
    public partial class TestDataAllCollectionTypes
    {
    }

}

namespace Test.ServiceModel.Types
{
    public partial class AllCollectionTypes
    {
        public AllCollectionTypes()
        {
            IntArray = new int[]{};
            IntList = new List<int>{};
            StringArray = new string[]{};
            StringList = new List<string>{};
            FloatArray = new float[]{};
            DoubleList = new List<double>{};
            ByteArray = new byte[]{};
            CharArray = new Char[]{};
            DecimalList = new List<decimal>{};
            PocoArray = new Poco[]{};
            PocoList = new List<Poco>{};
            PocoLookup = new Dictionary<string, List<Poco>>{};
            PocoLookupMap = new Dictionary<string, List<Dictionary<String,Poco>>>{};
        }

        public virtual int[] IntArray { get; set; }
        public virtual List<int> IntList { get; set; }
        public virtual string[] StringArray { get; set; }
        public virtual List<string> StringList { get; set; }
        public virtual float[] FloatArray { get; set; }
        public virtual List<double> DoubleList { get; set; }
        public virtual byte[] ByteArray { get; set; }
        public virtual Char[] CharArray { get; set; }
        public virtual List<decimal> DecimalList { get; set; }
        public virtual Poco[] PocoArray { get; set; }
        public virtual List<Poco> PocoList { get; set; }
        public virtual Dictionary<string, List<Poco>> PocoLookup { get; set; }
        public virtual Dictionary<string, List<Dictionary<String,Poco>>> PocoLookupMap { get; set; }
    }

    public partial class Poco
    {
        public virtual string Name { get; set; }
    }

}

C# TestDataAllCollectionTypes DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /testdata/AllCollectionTypes HTTP/1.1 
Host: test.servicestack.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"intArray":[0],"intList":[0],"stringArray":["String"],"stringList":["String"],"floatArray":[0],"doubleList":[0],"byteArray":"AA==","charArray":["\u0000"],"decimalList":[0],"pocoArray":[{"name":"String"}],"pocoList":[{"name":"String"}],"pocoLookup":{"String":[{"name":"String"}]},"pocoLookupMap":{"String":[{"String":{"name":"String"}}]}}