public void Bind(ICollection<CartItemInfo> cart) {
            if (cart != null) {
                repOrdered.DataSource = cart;
                repOrdered.DataBind();               
            }
其中CartItemInfo是个model,ICollection<CartItemInfo> 是什么意思?谢谢各位大大~!!!

解决方案 »

  1.   

    你可以简单认为是CartItemInfo的集合,比如一个 CartItemInfo 数组
      

  2.   

    [DefaultImplementation(typeof(GeneralServiceImp))]
        public interface IGeneralService
        {  ...
            /// where T : BaseEntity
            /// <param name="businessEntity">业务实体对象</param>
           ...
       void Insert<T>(T businessEntity) where T : Test.Core.Common.BaseEntity;
       void Update<T>(IList<T> businessEntities) where T : Test.Core.Common.BaseEntity;
      关于这个问题.本人正在进行中项目运用极多.提高了性能.可以看下 blog
      

  3.   

    一个只能是CartItemInfo类型的元素集
    以前的集合可以添加object类型的也就是任意的元素
    现在用ICollection<CartItemInfo> 来限制其元素只能是CartItemInfo类型的
    这样就有效的保证了类型安全
    具体的信息你可以去搜索泛型类
      

  4.   

    ICollection<CartItemInfo> ,是泛型方式变量定义,在你的方法中传入的参数需要实现该类型。