Sobes.tech
Junior — Middle

What is the name of the model type that is stored exclusively in a database?

sobes.tech AI

Answer from AI

The type of model that is stored exclusively in the database is usually called an Entity.

In the context of C# and ORM (such as Entity Framework), an entity is a class that represents a table in the database. It contains properties corresponding to the table columns and is used for reading and writing data.

Example:

public class UserEntity
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Email { get; set; }
}

Such models often differ from business models (Domain Models) or DTOs, as they are specifically designed for storing and retrieving data from the database.