Getting the typeof this to use in a generic method - C#