fork(1) download
  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. Processor processor = new Processor();
  10. processor.Process();
  11. }
  12. }
  13.  
  14. public class Processor
  15. {
  16. IDbTools<IDbCommand> DbTools { get; set; }
  17.  
  18. public Processor()
  19. {
  20. }
  21.  
  22. public void Process()
  23. {
  24. DbTools = (IDbTools<IDbCommand>) new Tools();
  25. DbTools.PrepareAndExecuteQuery(new SqlCommand());
  26. }
  27. }
  28.  
  29. public class Tools : IDbTools<SqlCommand>
  30. {
  31. public void PrepareAndExecuteQuery(SqlCommand command)
  32. { }
  33. }
  34.  
  35. public interface IDbTools<in TCommand>
  36. where TCommand : IDbCommand
  37. {
  38. void PrepareAndExecuteQuery(TCommand command);
  39. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(3,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(29,31): error CS0246: The type or namespace name `SqlCommand' could not be found. Are you missing an assembly reference?
prog.cs(36,19): error CS0246: The type or namespace name `IDbCommand' could not be found. Are you missing an assembly reference?
prog.cs(16,11): error CS0246: The type or namespace name `IDbCommand' could not be found. Are you missing an assembly reference?
prog.cs(31,37): error CS0246: The type or namespace name `SqlCommand' could not be found. Are you missing an assembly reference?
Compilation failed: 6 error(s), 0 warnings
stdout
Standard output is empty