public class RuleBuilder where T : class {} public interface IDynamicObject { RuleBuilder GetRule() where T : class; } public class RubyMethod : IDynamicObject { RuleBuilder IDynamicObject.GetRule() /* where T : class */ { return new RuleBuilder(); } } public class T { public static void Main () { } }