About 742,000 results
Open links in new tab
  1. 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 …

  2. Convert generic List/Enumerable to DataTable? - Stack Overflow

    I have few methods that returns different Generic Lists. Exists in .net any class static method or whatever to convert any list into a datatable? The only thing that i can imagine is use Reflecti...

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

  4. How to add a generic credential for a specific Windows User using ...

    Jun 14, 2024 · I'd like to add a generic credential to the Credential Manager on a Windows VM using a Powershell script which is executed by conducting a GitHub Action workflow. The …

  5. Create Generic method constraining T to an Enum

    Sep 17, 2008 · Create Generic method constraining T to an Enum Asked 17 years, 1 month ago Modified 4 months ago Viewed 532k times

  6. c# - Generic TryParse - Stack Overflow

    Jun 3, 2010 · I am trying to create a generic extension that uses 'TryParse' to check if a string is a given type: public static bool Is<T>(this string input) { T notUsed; return T.TryParse(input,...

  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. How can I return NULL from a generic method in C#?

    I think the problem with this is that if you're using this generic method to say, convert a Database object from DbNull to Int and it returns default (T) where T is an int, it'll return 0. If this number …

  9. Find a specified generic DbSet in a DbContext dynamically when I …

    Find a specified generic DbSet in a DbContext dynamically when I have an entity Asked 11 years, 9 months ago Modified 5 months ago Viewed 67k times

  10. How to make a Java Generic method static? - Stack Overflow

    The following is a snippet on how to make a java generic class to append a single item to an array. How can I make appendToArray a static method. Adding static to the method signature …