> ## 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.

# Retrieve an Entity property through an Entity

> Retrieve an Entity property through an Entity

The `Sale` Entity contains a property that in itself is an Entity. Examples of such include Contact and Person properties. These properties consist of different properties which could be of different data types such as String, Double, Integer, Row, and DateTime.

```csharp theme={null}
using SuperOffice.CRM.Entities;
using SuperOffice.CRM.Rows;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Retrieving an Entity
  Sale newSale = Sale.GetFromIdxSaleId(2);

  //Retrieving Properties of an Entity through an Entity
  //Basic Properties
  string salePerName = newSale.Person.Firstname + " " + newSale.Person.Lastname;
  string salePerDOB = newSale.Person.DayOfBirth.ToString();
  string salePerDept = newSale.Person.Department;

  //Row properties
  string salePerAdd = newSale.Person.Address.Address1;
  string salePerAddCoun = newSale.Person.Address.County;
  string saleCounEng = newSale.Person.Country.EnglishName;
  string saleCounName = newSale.Person.Country.Name;

  //Entity properties
  string salePerConName = newSale.Person.Contact.Name;
  string salePerConCoun =newSale.Person.Contact.Country.Name;

  //Rows property
  if (newSale.Person.Emails.Count != 0)
  {
    string[] saleEMAddress = new string[newSale.Person.Emails.Count];
    string[] saleEMDesc = new string[newSale.Person.Emails.Count];
    int i = 0;
    foreach (EmailRow email in newSale.Person.Emails)
    {
      saleEMAddress[i] = email.EmailAddress;
      saleEMDesc[i] = email.Description;
      i = i + 1;
    }
  }

  //Entity Collection properties
  if (newSale.Person.Sales.Count != 0)
  {
    string[] salPerSalAmt = new string[newSale.Person.Sales.Count];
    string[] salPerSalConNm = new string[newSale.Person.Sales.Count];
    int i = 0;
    foreach (Sale sale in newSale.Person.Sales)
    {
      salPerSalAmt[i] = sale.Amount.ToString();
      salPerSalConNm[i] = sale.Contact.Name;
      i = i + 1;
    }
  }
}
```

Here a `Sale` Entity is retrieved using the `IdxSaleId` class and some basic properties of the `Contact` Entity are retrieved through the `Sale` Entity.

The `Address` property (in the Contact of the Sale Entity) is of `Row` type. This means that it represents a row in the `Address` table. In this example, an Address row is retrieved.

The Sale Entity's `Person` has a property called `Emails`. It consists of multiple Email Rows of type `EmailRow`. The example shows how to retrieve each EmailRow of the Emails property of the Person through Sale Entity.

The Person property contains properties of `SaleCollection` type.

## See also

* [How to retrieve an Entity][1]
* [Retrieve a row through an Entity][2]

[1]: ./get-entity

[2]: ../rows/get-row-from-entity


## Related topics

- [How to retrieve members of a specific selection using entities](/en/api/search/selection/entity/get-selection-members-entity.md)
- [Get a contact through the services layer](/en/api/web-services/howto/company/get-contact-via-services-layer.md)
- [How to list all selected interests for a contact (services)](/en/api/web-services/howto/company/get-interests-for-contact-services.md)
- [Update a person with a new name, address, position using services](/en/api/web-services/howto/contact/update-person-services.md)
- [How to set an interest on or off for a contact (services)](/en/api/web-services/howto/company/set-interest-on-off-services.md)
- [Retrieving list of persons with ContactAgent](/en/api/web-services/howto/contact/get-persons-contactagent.md)
- [How to download a new document](/en/api/web-services/howto/document/services-download.md)
