I have some doubts in the constructor method of a class that I'm seeing as an example, if anyone can explain thanks.
private static IList<Categoria> categorias = new List<Categoria>()
{
new Categoria() {
CategoriaId = 1,
Nome = "Notebooks"},
new Categoria() {
CategoriaId = 2,
Nome = "Monitores"},
new Categoria() {
CategoriaId = 3,
Nome = "Impressoras"},
new Categoria() {
CategoriaId = 4,
Nome = "Mouses"},
new Categoria() {
CategoriaId = 5,
Nome = "Desktops"},
};
1st doubt - what is the word static
in this case?
2nd question - why was it declared categories as IList
of Categoria
and received List
, ie what is the difference of List
to IList
?