forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelWithComplexTypes.cs
More file actions
38 lines (34 loc) · 1.08 KB
/
ModelWithComplexTypes.cs
File metadata and controls
38 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
namespace ServiceStack.Text.Tests.DynamicModels
{
public class ModelWithComplexTypes
{
public class NestedType
{
public int IntValue { get; set; }
}
[Flags]
public enum MyEnum
{
Value = 12
}
public IList<string> ListValue { get; set; }
public IDictionary<string, string> DictionaryValue { get; set; }
public string[] ArrayValue { get; set; }
public byte[] ByteArrayValue { get; set; }
public MyEnum? EnumValue { get; set; }
public NestedType NestedTypeValue { get; set; }
public static ModelWithComplexTypes Create(int i)
{
return new ModelWithComplexTypes
{
DictionaryValue = new Dictionary<string, string> {{"a", i.ToString()}},
ListValue = new List<string> {i.ToString()},
ArrayValue = new string[]{},
EnumValue = MyEnum.Value,
ByteArrayValue = new byte[]{(byte)i},
};
}
}
}