Model
noun
say it: “MOD-ul” /ˈmɒdəl/
A class whose job is to carry data, with one property for each value.
What is Model in C#?
Model — A class whose job is to carry data: one property for each value, such as each column of a database row. The rest of the program passes models around instead of loose values.
class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; } = "";
public decimal UnitPrice { get; set; }
}
In a sentence
- “Each row from the Products table became a Product model with ProductId, ProductName and UnitPrice.”
Level: Apprentice · More C# terms at this level
Updated