什么是ICollection? [英] What is ICollection ?

查看:107
本文介绍了什么是ICollection?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





什么是ICollection?



以下代码是什么意思


  public   virtual  ICollection< Department>部门{获取;  set ; } 





提前致谢..

解决方案

 ICollection <   T  > 接口是System.Collections.Generic命名空间中类的基本接口。 ICollection <   T  > 界面扩展IEnumerable <   T  > 和由IDictionary扩展<   TKey,    TValue  > 和IList <  < span class =code-leadattribute> T  > 。 IDictionary <   TKey,    TValue  > 实现是键/值对的集合,如Dictionary <   TKey,    TValue  > 类。 IList <   T  > 实施是一组值,其成员可以通过索引访问,例如List <   T  < span class =code-keyword>>  class。





  private   void  SendEmail( string  host, int 端口,
字符串用户名,字符串密码,
字符串 来自 string to,
string subject, string body,
ICollection& amp; lt; string& amp; gt; att achedFiles)


hi,

What is ICollection?

What is meant by below code

public virtual ICollection<Department> Departments { get; set; }



Thanks in advance..

解决方案

The ICollection<T> interface is the base interface for classes in the System.Collections.Generic namespace. The ICollection<T> interface extends IEnumerable<T> and is extended by IDictionary<TKey, TValue> and IList<T>. An IDictionary<TKey, TValue> implementation is a collection of key/value pairs, like the Dictionary<TKey, TValue> class. An IList<T> implementation is a collection of values, and its members can be accessed by index, like the List<T> class.



private void SendEmail(string host, int port,
        string username, string password,
        string from, string to,
        string subject, string body,
        ICollection&amp;lt;string&amp;gt; attachedFiles)


这篇关于什么是ICollection?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆