fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace SO16390592
  6. {
  7. class Program
  8. {
  9. static void Main()
  10. {
  11. ISelectSingleSpace test = new Test();
  12. test.AvailableSpaces = new List<Space>(new Space[1]);
  13. test.DoStuff();
  14. }
  15. }
  16.  
  17. public class Space
  18. {
  19.  
  20. }
  21.  
  22. public interface ISelectSpace
  23. {
  24. bool ShowSpaceSelection { get; set; }
  25. IEnumerable<Space> AvailableSpaces { get; set; }
  26. }
  27.  
  28.  
  29. public interface ISelectSingleSpace : ISelectSpace
  30. {
  31. string Space { get; set; }
  32. string SpaceName { get; set; }
  33. }
  34.  
  35. public class Test : ISelectSingleSpace
  36. {
  37. public bool ShowSpaceSelection { get; set; }
  38. public IEnumerable<Space> AvailableSpaces { get; set; }
  39. public string Space { get; set; }
  40. public string SpaceName { get; set; }
  41. }
  42.  
  43.  
  44. public static class SelectSingleSpace
  45. {
  46. public static void DoStuff(this ISelectSingleSpace selectSingleSpace)
  47. {
  48. Console.Write(selectSingleSpace.AvailableSpaces.Count());
  49. }
  50. }
  51. }
  52.  
Success #stdin #stdout 0.03s 33928KB
stdin
Standard input is empty
stdout
1