Created
February 1, 2015 17:29
-
-
Save rpgmaker/94160ae6c9d799e8ddcd to your computer and use it in GitHub Desktop.
Test Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
[DataContract] | |
public class Test { | |
[DataMember(Order = 1)] | |
public int ID { get; set; } | |
[DataMember(Order = 2)] | |
public string Text { get; set; } | |
[DataMember(Order = 3)] | |
public Complex Inner { get; set; } | |
} | |
[Serializable] | |
[DataContract] | |
public class Complex { | |
[DataMember(Order = 1)] | |
public int ID { get; set; } | |
[DataMember(Order = 2)] | |
public string Name { get; set; } | |
[DataMember(Order = 3)] | |
public List<DataEx> List { get; set; } | |
[DataMember(Order = 4)] | |
public Dictionary<string, DataEx> Dict { get; set; } | |
//[DataMember(Order = 5)] | |
//public Double Db { get; set; } | |
//[DataMember(Order = 6)] | |
//public Decimal Dec { get; set; } | |
[DataMember(Order = 7)] | |
public MyEnumEx MyE { get; set; } | |
//public Dictionary<int, int> DictInt { get; set; } | |
} | |
[Serializable] | |
[DataContract] | |
public class DataEx { | |
[DataMember(Order = 1)] | |
public string Text { get; set; } | |
[DataMember(Order = 2)] | |
public List<string> DataTexts { get; set; } | |
[DataMember(Order = 3)] | |
public int[] Buffer { get; set; } | |
[DataMember(Order = 4)] | |
public string[] Items { get; set; } | |
[DataMember(Order = 5)] | |
public bool YesNo { get; set; } | |
[DataMember(Order = 6)] | |
public DateTime CreateDate { get; set; } | |
//[DataMember(Order = 7)] | |
//public int[] Items2 { get; set; } | |
//[DataMember(Order = 7)] | |
//public DateTime[] Items3 { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Test complexObject = new Test { | |
ID = 100, | |
Text = "Olamide", | |
Inner = new Complex { | |
ID = 400, | |
//DictInt = new Dictionary<int, int> { { 1, 2 }, { 2, 3 } }, | |
Name = "ComplexObject", | |
Dict = new Dictionary<string, DataEx> { | |
{"First", new DataEx{ Text = "DictData" }} | |
}, | |
//Db = 324324343943543.34234d, | |
//Dec = Decimal.MaxValue, | |
MyE = MyEnumEx.B, | |
List = new List<DataEx> { | |
new DataEx { | |
Text = "DataText", | |
CreateDate = DateTime.UtcNow, | |
DataTexts = new List<string>{ "String1", "String2" }, | |
//Buffer = new int[]{19,33,45,66,23,123,55,33,55,14,67,74}, | |
Items = new string[]{ "Item1", "Item2"}, | |
//Items2 = new int[]{1,2,3,4}, | |
//Items3 = new DateTime[]{DateTime.Now, DateTime.MinValue, DateTime.MaxValue }, | |
YesNo = true, | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment