Gabriel G. Roy
Gabriel G. Roy

Reputation: 2632

Resharper patterns: string to type in generic method

Simply put, is it possible to use patterns in Resharper to do the following replacement:

Before:

AddType("MyApplication.Something.SomeObject", "ObjectName");

After

AddType<MyApplication.Something.SomeObject>("ObjectName");

Upvotes: 4

Views: 118

Answers (1)

Dmitri Nesteruk
Dmitri Nesteruk

Reputation: 23789

Sorry, but this won't work, mainly because SSR does not have a concept of a literal, and specifying arguments as AddType("$FOO$", "$BAR$") will not result in a successful match if $FOO$ and $BAR$ are declared as argument placeholders.

Upvotes: 2

Related Questions