C# List<T> in Static Structure / Class Diagram

S

SDM_NYC

Is there a way to define a Generic datatype in a C# class ??

(I suppose I could create a custom datatype List<foo>, List<bar>, list<xxxx>
whenever I need to code one ... but it would not be dynamic ... so that if I
changed the foo class to be called the f00 class .. it would not update all
instances.

Strange that this is not something that more have requested ... or am I just
missing the best practice for doing this ??

Thanks,

Steve
 
S

Steve

You can use generic classes to define collections like linked lists, stacks,
and other common data structures. See
http://msdn.microsoft.com/en-us/library/sz6zd40f(VS.80).aspx for an
overview. (This is for ASP.NET 2.0). The .NET Framework (2.0+) defines
several generic classes in the System.Collections.Generic namespace. See
http://msdn.microsoft.com/en-us/library/system.collections.generic(VS.80).aspx

If you require more detail, you should probably post to one of the C#
programming newsgroups.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top