5
Answers

Extension methods

Ask a question
S

S

12y
1.3k
1
Ive wrote a few Extension\Helper methods for converting data from a database into a business object of the same type.

For example I have AsId(); which converts\casts a string to an int.

However, when I come to bolt on one of my Extension methods I am unable to, I want AsId(); added like so

CustomerId = reader["CustomerId"].AsId();

But when I use try to access the method from intellisense it only gives me the common base types ie ToString() etc.

How can I get intellisense to pick up my set of Extension methods? ive seen it done before but cant work out how to do it...




Answers (5)