Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collections - Lists

Today I need to do an exercice regarding collections.

My Solution have 3 Projects, one is called "Console" the other is called "Entities" and the new project is called "Business".

My Console projects have the Main entry point. My Entities project have all the classes and parent classes of this exercise. My new project called Business have a class called Clientadm.

Edit1: This last class have a method that lists the instances of a class called "ClientIndividual" inside Entities.

        #region Metodos
        List<ClienteIndividuo> ListarClienteIndividuo = new List<ClienteIndividuo>();
        #endregion

The problem is I see a red line in new list saying "Is innacesible due to its protection level".

I have a reference called "Entities" in my Business proyect. Im using Entities namespace on my Clientadm class. My class ClientIndividual is just class, not abstract.

what could it be?

Thanks.

Edit2: Also, intellisense is not working when I want to write any classes of entities into business.

like image 955
Nickso Avatar asked Mar 14 '26 20:03

Nickso


1 Answers

Make sure that both the class is public as well as any attributes that you want to access are declared public as the default in C# is private. Example class below.

public class FooBar {  
    public List<string> Foo { get; set; }
}

MS Docs

like image 94
Brant Olsen Avatar answered Mar 16 '26 10:03

Brant Olsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!