C# <> expression

  • Thread starter Thread starter c676228
  • Start date Start date
C

c676228

Hi all,

I often encounter this kind of experssion in the code developed by our vendor:

HiddenField h = TISVendor.Find<HiddenField>.Within(Page, "hidLayoutID");
//TISVedor is our vendor's specific component

u = Select<UserInput>.QuerySingle(param1, param2, param3);

I came from Java and really feel that <Parameter> experssion strange and
uncomforatable. Can you explain a bit more or direct me to some resouces I
can take look. I noticed in MS development, there are a lot experssion like
that, just not use to it.

Thanks,

Betty
 
Betty,

What you are describing is known as Generics. Generic classes are usually
preferred to avoid redundant, similar code. Another advantage is using them
for type-safe programming and collections.

In the example you provided TISVender.Find<HiddenField>() is a generic
method and Select<UserInput> is a generic class.

You can read more about generics at MSDN,
http://msdn.microsoft.com/en-us/library/512aeb7t.aspx.
 
Hi Stanimir and Peter,

Thanks for your great anwsers. The link provided by Stanimir is very helpful.

Sincerely
 
Back
Top