2 using System.Collections;
3 using System.Collections.Generic;
4 using System.ComponentModel.DataAnnotations;
7 using System.Web.DynamicData;
8 using System.Web.DynamicData.ModelProviders;
10 using System.Web.UI.WebControls;
12 using MonoTests.System.Web.DynamicData;
13 using MonoTests.ModelProviders;
14 using MonoTests.DataSource;
16 namespace MonoTests.Common
18 public class TestDataContext3 : ITestDataContext
20 List<AssociatedFoo> associatedFoo;
21 List<AssociatedBar> associatedBar;
22 List<BazWithDataTypeAttribute> bazWithDataTypeAttribute;
24 public List<AssociatedFoo> AssociatedFoo
28 if (associatedFoo == null)
29 associatedFoo = new List<AssociatedFoo> ();
35 public List<AssociatedBar> AssociatedBar
39 if (associatedBar == null)
40 associatedBar = new List<AssociatedBar> ();
46 public List<BazWithDataTypeAttribute> BazWithDataTypeAttribute
50 if (bazWithDataTypeAttribute == null)
51 bazWithDataTypeAttribute = new List<BazWithDataTypeAttribute> ();
53 return bazWithDataTypeAttribute;
57 #region ITestDataContext Members
58 public IList GetTableData (string tableName, DataSourceSelectArguments args, string where, ParameterCollection whereParams)
60 if (String.Compare (tableName, "AssociatedFooTable", StringComparison.OrdinalIgnoreCase) == 0)
63 if (String.Compare (tableName, "AssociatedBarTable", StringComparison.OrdinalIgnoreCase) == 0)
66 if (String.Compare (tableName, "BazWithDataTypeAttributeTable", StringComparison.OrdinalIgnoreCase) == 0)
67 return BazWithDataTypeAttribute;
72 public List<DynamicDataTable> GetTables ()
74 return new List<DynamicDataTable> {
75 new TestDataTable<AssociatedBar>(),
76 new TestDataTable<AssociatedFoo>(),
77 new TestDataTable<BazWithDataTypeAttribute> ()