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

    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 be a …

  2. A generic error occurred in GDI+, JPEG Image to MemoryStream

    Jun 27, 2009 · In the following code, the t.Save () method call throws our friend the generic exception when the pixel height is 65501 for me. For reasons of curiosity, I repeated the test for width, and the …

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

  4. How do I check if a given value is a generic list? - Stack Overflow

    122 public bool IsList(object value) { Type type = value.GetType(); // Check if type is a generic list of any type } What's the best way to check if the given object is a list, or can be cast to a list?

  5. 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 type which has …

  6. 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 entire purpose …

  7. C# - Multiple generic types in one list - Stack Overflow

    Mar 5, 2017 · The generic type (DataType) is limited to value types by the where statement. What I want to do is have a list of these Metadata objects of varying types (DataType).

  8. Nullable type as a generic parameter possible? - Stack Overflow

    Oct 16, 2008 · The type 'int?' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method Is specifying a nullable type as a generic parameter at all possible?

  9. Is there a generic constructor with parameter constraint in C#?

    Here is a workaround for this that I personally find quite effective. If you think of what a generic parameterized constructor constraint is, it's really a mapping between types and constructors with a …

  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 …