Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

what is the difference between ICollection and List?

$
0
0

Hi,

what is the difference between ICollection and List? Can you explain 

public class Category
    {
        public int CategoryId { get; set; }
        public string CategoryCode { get; set; }
        public string Image { get; set; }
        public int? ParentId { get; set; }

        public ICollection<CategoryDetail> CategoryDetails { get; set; }

        public List<ProductCategory> ProductsCategories { get; set; }
    }

public class CategoryDetail
    {
        public int CategoryDetailId { get; set; }
        
        public DateTime UpdateDate { get; set; }
        public int? CategoryId { get; set; }
        public Category Category { get; set; }

        public string Icon { get; set; }
        public int SortOrder { get; set; }
        public string Url { get; set; }
        public bool IsApproved { get; set; }
         
    }

public class ProductCategory
    {      
        public int CategoryId { get; set; }
        public Category Category { get; set; }

        public int ProductId { get; set; }
        public Product Product { get; set; }

    }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>