public class Customer { public int Id { get; set; } public string Name { get; set; } public string Email { get; set; } public bool IsGoldMember { get; set; } }
public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } public int QuantityInStock { get; set; } }This model contains four properties: Id, Name, Price, and QuantityInStock, which represent the attributes of a product. Again, each property has a get and set method to allow access and modification of the data. C# models are often part of larger packages or libraries that provide functionality for working with data and entities. Some popular libraries include Entity Framework, which provides an object-relational mapping (ORM) framework for working with databases, and Newtonsoft.Json, which provides utilities for working with JSON data.