public DollarCountEntitiesController() { Entities = new List <DollarCountEntity>(); for (int i = 1; i <= 10; i++) { if (i % 2 == 0) { var newEntity = new DollarCountEntity { Id = i, StringCollectionProp = Enumerable.Range(1, 2).Select(index => index.ToString()).ToArray(), EnumCollectionProp = new[] { Color.Red, Color.Blue | Color.Green, Color.Green }, TimeSpanCollectionProp = Enumerable.Range(1, 4).Select(_ => TimeSpan.Zero).ToArray(), ComplexCollectionProp = Enumerable.Range(1, 5).Select(_ => new DollarCountComplex()).ToArray(), EntityCollectionProp = Entities.ToArray(), DollarCountNotAllowedCollectionProp = new[] { 1, 2, 3, 4 } }; Entities.Add(newEntity); } else { var newEntity = new DerivedDollarCountEntity { Id = i, StringCollectionProp = Enumerable.Range(1, 2).Select(index => index.ToString()).ToArray(), EnumCollectionProp = new[] { Color.Red, Color.Blue | Color.Green, Color.Green }, TimeSpanCollectionProp = Enumerable.Range(1, 4).Select(_ => TimeSpan.Zero).ToArray(), ComplexCollectionProp = Enumerable.Range(1, 5).Select(_ => new DollarCountComplex()).ToArray(), EntityCollectionProp = Entities.ToArray(), DollarCountNotAllowedCollectionProp = new[] { 1, 2, 3, 4 }, DerivedProp = "DerivedProp" }; Entities.Add(newEntity); } } }
public DollarCountEntitiesController() { Entities = new List<DollarCountEntity>(); for (int i = 1; i <= 10; i++) { if (i % 2 == 0) { var newEntity = new DollarCountEntity { Id = i, StringCollectionProp = Enumerable.Range(1, 2).Select(index => index.ToString()).ToArray(), EnumCollectionProp = new[] { Color.Red, Color.Blue | Color.Green, Color.Green }, TimeSpanCollectionProp = Enumerable.Range(1, 4).Select(_ => TimeSpan.Zero).ToArray(), ComplexCollectionProp = Enumerable.Range(1, 5).Select(_ => new DollarCountComplex()).ToArray(), EntityCollectionProp = Entities.ToArray(), DollarCountNotAllowedCollectionProp = new[] { 1, 2, 3, 4 } }; Entities.Add(newEntity); } else { var newEntity = new DerivedDollarCountEntity { Id = i, StringCollectionProp = Enumerable.Range(1, 2).Select(index => index.ToString()).ToArray(), EnumCollectionProp = new[] { Color.Red, Color.Blue | Color.Green, Color.Green }, TimeSpanCollectionProp = Enumerable.Range(1, 4).Select(_ => TimeSpan.Zero).ToArray(), ComplexCollectionProp = Enumerable.Range(1, 5).Select(_ => new DollarCountComplex()).ToArray(), EntityCollectionProp = Entities.ToArray(), DollarCountNotAllowedCollectionProp = new[] { 1, 2, 3, 4 }, DerivedProp = "DerivedProp" }; Entities.Add(newEntity); } } }