# Entities

Entities are distinct from other domain concepts such as Value Objects and Aggregates. Value Objects are immutable objects whose equality is based on their attribute values, while Aggregates are groups of related entities and value objects treated as a single unit for consistency and transactional boundaries.

{% hint style="info" %}
**Eiffel.Modelling.Abstractions** NuGet package contains base Entity class. By using abstract Entity class you can define your entities.
{% endhint %}

```csharp
/// <summary>
/// Base entity class
/// </summary>
/// <typeparam name="TKey">The type of database primary key</typeparam>
public abstract class EntityBase<TKey>
    where TKey : struct, IEquatable<TKey>
{
    /// <summary>
    /// Primary key
    /// </summary>
    [Key]
    public TKey Id { get; internal set; }
}
```

Entities are typically implemented as classes in object-oriented programming languages, and their properties and behavior reflect the essential attributes and operations of the corresponding real-world objects they represent in the domain.

*Example Passenger entity with properties.*

```csharp
public class Passenger : EnttiyBase<long>
{
    public string Name { get; private set; }

    public string Surname { get; private set; }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eiffel.dev/principles/domain-driven-design/entities.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
