About 783,000 results
Open links in new tab
  1. How can I pass in a func with a generic type parameter?

    Mar 24, 2014 · You can certainly define generic delegates, after all, that's exactly what Func and Action are. They are treated as generic definitions, just like generic interfaces and classes are. …

  2. What is the syntax for Typescript arrow functions with generics?

    Aug 31, 2015 · The typescript handbook currently has nothing on arrow functions. Normal functions can be generically typed with this syntax: example: function identity<T>(arg: T): …

  3. c# - How to compare values of generic types? - Stack Overflow

    So, two questions: Why do we observe this weird behaviour? What keeps us from comparing the values of generic types which are known to be IComparable? Doesn't it somehow defeat the …

  4. Can I make a generic optional, defaulting to a certain class?

    Dec 5, 2012 · My question is related to Is there a reasonable approach to "default" type parameters in C# Generics?, but using an inner generic class that approach doesn't work. …

  5. Using Mockito to mock classes with generic parameters

    Is there a clean method of mocking a class with generic parameters? Say I have to mock a class Foo<T> which I need to pass into a method that expects a Foo<Bar>. I can do the …

  6. Creating a generic method in C# - Stack Overflow

    Jan 27, 2010 · I am trying to combine a bunch of similar methods into a generic method. I have several methods that return the value of a querystring, or null if that querystring does not exist …

  7. Generics in C#, using type of a variable as parameter

    Feb 11, 2015 · Why? Because under the hood, the compiler will go away and create a new type (sometimes called a closed generic type) for each different usage of the "open" generic type. …

  8. windows - cmdkey: what's the difference between generic …

    May 27, 2021 · CRED_TYPE_GENERIC_CERTIFICATE = 5 (0x5) The credential is a certificate credential that is a generic authentication package. Windows Server 2008, Windows Vista, …

  9. Generic type as parameter in Java Method - Stack Overflow

    Jul 20, 2011 · Generic type as parameter in Java Method Asked 14 years ago Modified 2 years, 3 months ago Viewed 157k times

  10. How do I get a class instance of generic type T? - Stack Overflow

    I have a generics class, Foo<T>. In a method of Foo, I want to get the class instance of type T, but I just can't call T.class. What is the preferred way to get around it using T.class?