> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a contact through entities layer

> How to get a Contact through Entities layer.

Getting a contact through the **entities layer** is pretty straightforward. You need to import the `SuperOffice.CRM.Entities` namespace.

The following example shows how it is done.

```csharp theme={null}
using SuperOffice;
using SuperOffice.CRM.Entities;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Get a contact through Idx class
  Contact contactThroughIdx = Contact.GetFromIdxContactId(3);

  //Access the Name property
  string name = contactThroughIdx.Name;
}
```

When retrieving a `Contact` entity through an Idx class, you have to pass the ID of the entity. Then all its properties will be retrieved from the database and kept in memory. This allows you to access the properties.

You can alternatively [use the services layer][1].

[1]: ../../../web-services/howto/company/get-contact-via-services-layer


## Related topics

- [Get a contact through the services layer](/en/api/web-services/howto/company/get-contact-via-services-layer.md)
- [Working with companies in API](/en/company/dev/index.md)
- [Get Contact Entity](/en/api/reference/restful/rest/contact/get-contact-entity.md)
- [How to add members to a static selection using entities layer](/en/api/search/selection/entity/add-member-to-static-selection-entities.md)
- [How to link a sale to a follow-up (services)](/en/api/web-services/howto/sale/link-sale-to-appointment.md)
- [Retrieving list of persons with ContactAgent](/en/api/web-services/howto/contact/get-persons-contactagent.md)
