A plain old CLR object (POCO) is an ordinary .NET class that does not depend on a specialized framework base class or programming model. Framework features can populate, serialize, or map these objects while application code works with familiar properties and collections. section 7.0 section 12.2.2
POCOs appear in several common framework roles:
- Model binding populates POCO properties from values in an HTTP request and passes the resulting object to an endpoint handler. section 7.0
- The IOptions<T> binder creates nonabstract POCO options classes with public parameterless constructors, then binds eligible public properties. section 10.3.3
- EF Core uses POCO classes as entities and applies conventions such as Id-suffixed primary keys and foreign-key relationships. section 12.2.2
- Minimal API handlers can return POCOs, which are serialized as JSON in a successful response. section 5.3
Recipe entities
A Recipe class with RecipeId, Name, and an ICollection<Ingredient> can remain an ordinary C# class while EF Core interprets its properties as database keys and relationships. section 12.2.2
Listing 12.2 Defining the EF Core entity classes
public class Recipe
{
public int RecipeId { get; set; }
public required string Name { get; set; }
public TimeSpan TimeToCook { get; set; }
public bool IsDeleted { get; set; }
public required string Method { get; set; }
public required ICollection<Ingredient> Ingredients { get; set; } #1
}
public class Ingredient
{
public int IngredientId { get; set; }
public int RecipeId { get; set; }
public required string Name { get; set; }
public decimal Quantity { get; set; }
public required string Unit { get; set; }
}
Inspect the Recipe and Ingredient classes to see how simple properties and a collection express an EF Core data model. section 12.2.2

