Page 1 of 1

ICollection supported by Unity?

Posted: 07 Feb 2011, 21:41
by fernando24691
Hello.

I've been trying to use ICollection<Users> to send object messages to custom users, but I cannot manage to create one.

I saw that ICollection belongs to .NET Framework 4, but Unity only has support up for .NET Framework 3.5.

Am I wrong? Is there any way to solve this?? :(

Thanks!

Posted: 07 Feb 2011, 22:10
by tchen
ICollection<T> is an interface and as such, doesn't support creation directly. You need to use an implementing class such as List<T> or Dictionary<K,V>

There's a whole bunch of them in the system.collections.generic namespace

http://msdn.microsoft.com/en-us/library ... 90%29.aspx


edited: added reference link

Posted: 07 Feb 2011, 22:28
by fernando24691
Solved! Thank you very much! :D