TestDataContainer.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using MonoTests.DataSource;
  8. using MonoTests.ModelProviders;
  9. namespace MonoTests.Common
  10. {
  11. public class TestDataContainer <TContext>: DynamicDataContainer<TContext> where TContext: ITestDataContext
  12. {
  13. public TestDataContainer ()
  14. { }
  15. public TestDataContainer (string tableName)
  16. : base (tableName)
  17. { }
  18. public override int Update (IDictionary keys, IDictionary values, IDictionary oldValues)
  19. {
  20. throw new NotImplementedException ();
  21. }
  22. public override int Insert (IDictionary values)
  23. {
  24. throw new NotImplementedException ();
  25. }
  26. public override int Delete (IDictionary keys, IDictionary oldValues)
  27. {
  28. throw new NotImplementedException ();
  29. }
  30. public override IEnumerable Select (DataSourceSelectArguments args, string where, ParameterCollection whereParams)
  31. {
  32. TContext contextInstance = ContainedTypeInstance;
  33. return ContainedTypeInstance.GetTableData (TableName, args, where, whereParams);
  34. }
  35. public override List<DynamicDataTable> GetTables ()
  36. {
  37. var data = Activator.CreateInstance<TContext> ();
  38. return data.GetTables ();
  39. }
  40. }
  41. }