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. 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 …

  3. 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): …

  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. C# generic type constraint for everything nullable

    Apr 11, 2017 · The first suggestion using default is perfect! Now my template with a generic type being returned can return a null for objects and the default value for built-in types.

  6. Generic constraints, where T : struct and where T : class

    Jun 4, 2010 · Actually, it is possible to differentiate the type of a method call based upon constraints if one doesn't mind having a dummy "optional" parameter of a generic reference …

  7. 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 …

  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. 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. …

  10. c# - A generic error occurred in GDI+ - Stack Overflow

    A generic error occurred in GDI+ Asked 13 years, 11 months ago Modified 5 months ago Viewed 62k times