Models
Models are simple POCO (Plain Old C# Objects) classes representing your business domain data. For an e-commerce business, model classes would be Product
, Order
, and Inventory
. If you are building an application for a university, model classes would be Student
, Teacher,
and Subject
. Models represent the business domain data in your application and they are not aware of the underlying database that is being used in your application. In fact, you don't even need a database to work with models.
They can represent the data stored in an XML file or CSV file or any other data in your application. Having said that, these models could be used to interact with your database (in most cases) but they don't have any dependency to the database.
The following steps describe how to create an ASP.NET Core application that uses Models:
Make sure to create an ASP.NET 5 application with an empty template. Install the ASP.NET CoreĀ
NuGet
package and configure this, as discussed in an earlier chapter.Create...