Maybe. But C# generics aren't C++ templates - you can't call two different overloads of a method based on the concretization of a generic type, because the concretization doesn't happen at compile time.
It would look like this:
publicvoid Func<T>(Dictionary<T, int> somename)
But going by the description, there's a good chance you can't do this (or actually you could, but you'd have to manually test the type of T, and that's arguably a worse situation than you're on now).
I'd suggest looking at whatever part(s) of the functions that are truly identical (including types) and factoring that logic out of the two specific implementations, into a (private) sub-function.
Or use the generic implementation as suggested by Harold.
Either way, be careful to avoid falling back to an object-based (non-generic) implementation, because boxing-unboxing will impact your performance.
Last Visit: 31-Dec-99 18:00 Last Update: 10-Mar-14 12:50