Computer Magic Logo
Model

Monday, March 14, 2016

Published by Aristotelis Pitaridis

The first thing that we have to make is to define the model or the models for the data that we will deliver to other applications. For our example we will use the Product model which will contains the product id, the name of the product and the price of the product.

namespace ComputerMagic.Models
{
    public class Product
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
    }
}

There is not something special in our model. It is a normal class that we have defined all the fields that our model should store.