static void Main(string[] args) { var wrapper = new MyContextWrapper <MyClass, DBContext>(); wrapper.MethodOne(); wrapper.MethodTwo(); }