Creating new method c# methodname(Variable) -


I found a method like this ReadAsAsync & lt; T & gt; (This HttpContent content); in c # and I do not know what type of method and question popup on my head

"It is possible to create a method like 'MethodName & lt; varible & gt; (variable) {} ' and is this method elsewhere? "

For example:

  Public Zune Alias ​​& lt; String getText> (string text) {getText = text; }   

And when I call the method:

  string sampleText; Legal name & lt; Sample text & gt; ("Hello World");   

Then the value of sampleText will be "Hello World" .

I know this type of method is useless because you can set the value of the sample such as

  string sampleText = "";   

But I just want to do some experiment, thanks.

I found some method readAsAsync & lt; T & gt; (This HttpContent content); In C # and I do not know which type of method and question popup on my head

This is a general method By specifying this is what you want:

  Foo results = wait for the response. the seminar. Readsink & lt; Foo & gt; (); You can read more about this on MSDN:  

It is possible to make a method like "method method (variable) {} 'and it does so Is the method somewhere present? "

No, what you are trying to do is not possible. & lt; ... & gt; What is happening between a type , no variable

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -