C# Generics, what does T<,> mean? [duplicate] - c#

This question already has answers here:
Generics open and closed constructed types
(3 answers)
C# Language: generics, open/closed, bound/unbound, constructed
(2 answers)
Closed 3 years ago.
I have not seen this <,>-syntax before, and its impossible to google.
cfg.For(typeof(IPipelineBehavior<,>)).Add(typeof(OuterBehavior<,>));
.. I m guessing its some kind of wildcard, but I cant find any documentation
Source (for example)

Related

C# Check if a method exists in TDD [duplicate]

This question already has answers here:
How to check whether an object has certain method/property?
(5 answers)
Reflection GetMethod. select a more specific method
(3 answers)
Closed 11 months ago.
In Java I can check if a method named "addNumbers" exists in a class "Calculate" by doing this:
Class<?> c = Class.forName("com.example.package.Calculate");
Method m = c.getMethod("addNumbers", int.class, int.class);
m.invoke(5,7)
What is the C# equivalent for this example?

Inline using how to make use of it [duplicate]

This question already has answers here:
Using statement question
(6 answers)
What are the uses of "using" in C#?
(29 answers)
Closed 4 years ago.
In C# one can type the using verb in line width the code sometimes, like
using (textwriter){ ..... }
I like that writing style and am wondered what is required to allow that for my own Api's.
As long as your objects are IDisposable then you can use it with the using statement.

Another usage of # operator in C#? [duplicate]

This question already has answers here:
What's the use/meaning of the # character in variable names in C#?
(9 answers)
What does the # symbol before a variable name mean in C#? [duplicate]
(4 answers)
Closed 7 years ago.
I just found out something like this which works in C# code.
foreach (var item in list)
{
Console.WriteLine(#item);
}
Can anyone explain how is this possible - I have not found any documentation in ECMA for this.

How to declare an Optional type in C#? [duplicate]

This question already has answers here:
Optional return in C#.Net
(13 answers)
Closed 8 years ago.
Java 8 has Optional<T> which is nice way to declare optional types as described here.
Is there an equivalent way to that in C# ?
As per this answer You could make a struct that mimics this this type of functionality.

class and structure [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
When to use struct in C#?
Why should we use class instead of structure
Your question is a bit broad but normally but Microsoft gives good answers, http://msdn.microsoft.com/en-us/library/2hkbth2a(v=vs.80).aspx .

Categories