using System; using System.Collections.Generic; using System.Text; namespace CS20Tests { class Program { private string _foo; public string Foo { get { return _foo; } set { _foo = value; } } static void Main( string[] args ) { Nullable specialInt = null; int i = 3; specialInt = 4; i = (int)specialInt; Console.WriteLine( "i={0}", i ); i = 6; specialInt = i; specialInt++; Console.WriteLine( "specialInt={0}", specialInt ); for( int foo = 0; foo < 10; foo++ ) { } } } class Blaat { public Blaat() { Foo(); } public void Foo() { Entity e = new Entity("Duh"); PerformActions( e ); } public void PerformActions( T e ) where T : IEntityCore { List objects = e.GetObjects(); } } class Entity : IEntity { private string _foo; public Entity(string foo) { _foo = foo; } public List GetObjects() { List toReturn = new List(); toReturn.Add( this ); return toReturn; } public void Bar( IEntity t ) { } } class Entity2 : IEntity2 { private string _foo; public Entity2( string foo ) { _foo = foo; } public List GetObjects() { List toReturn = new List(); toReturn.Add( this ); return toReturn; } public void Bar( IEntity2 t ) { } } class Factory : IFactory { public Entity Create() { return new Entity( "lalala" ); } } class Factory2 : IFactory { public Entity2 Create() { return new Entity2( "lalala" ); } } interface IFactory //where T : IEntityCore { T Create(); } interface IEntityCore { List GetObjects(); string Value // <<<<<<< HERE } interface IEntity : IEntityCore { } interface IEntity2 : IEntityCore { } }