About 53 results
Open links in new tab
  1. What's the difference between "general" and "generic"?

    Apr 30, 2014 · Generic is the opposite of specific. Generic and specific refer to the identification of a fact. Specific means a fact that has been specified. If you ask for (specify) a pain reliever, aspirin would …

  2. How do I call a generic method using a Type variable?

    What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime? Consider the following sample code - inside the Ex...

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

  4. How to define generic type limit to primitive types?

    Apr 30, 2009 · I have the following method with generic type: T GetValue<T> (); I would like to limit T to primitive types such as int, string, float but not class type. I know I can define generic for clas...

  5. c# - Is there a constraint that restricts my generic method to numeric ...

    Aug 28, 2008 · So, my approach was to put all my logic into a generic method with no constraints, but to make that generic method private. I then exposed it with public methods, one explicitly handling the …

  6. How to run .NET Core Console app using generic host builder

    Jul 15, 2021 · How to run .NET Core Console app using generic host builder Asked 4 years, 9 months ago Modified 2 years, 3 months ago Viewed 97k times

  7. Find a specified generic DbSet in a DbContext dynamically when I have ...

    The question does not specify EF version and the proposed answer does not work anymore for Entity Framework Core (in EF Core, DbContext does not have a non-generic Set method, at least at the …

  8. Initializing a Generic variable from a C# Type Variable

    Jul 8, 2013 · That is, it is impossible to type a variable as a generic type if you don't know the type parameters at compile-time. Generics are compile-time constructs, and rely on having the type …

  9. No generic implementation of OrderedDictionary? - Stack Overflow

    Apr 13, 2010 · 107 Implementing a generic OrderedDictionary isn't terribly difficult, but it's unnecessarily time consuming and frankly this class is a huge oversight on Microsoft's part. There are multiple …

  10. How to get the type of T from a member of a generic class or method

    This appears to address the question of whether the type is a list-y sort of thing, but the question is more about how to determine what generic type parameter a type that is known to be a List already was …