Working with generics in C#