public void Bind(ICollection<CartItemInfo> cart) {
if (cart != null) {
repOrdered.DataSource = cart;
repOrdered.DataBind();
}
其中CartItemInfo是个model,ICollection<CartItemInfo> 是什么意思?谢谢各位大大~!!!
if (cart != null) {
repOrdered.DataSource = cart;
repOrdered.DataBind();
}
其中CartItemInfo是个model,ICollection<CartItemInfo> 是什么意思?谢谢各位大大~!!!
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
以前的集合可以添加object类型的也就是任意的元素
现在用ICollection<CartItemInfo> 来限制其元素只能是CartItemInfo类型的
这样就有效的保证了类型安全
具体的信息你可以去搜索泛型类