The model classes or poco classes

The poco classes are used with Entity framework to work with database. These classes defines properties of data store in database.They have no dependency on Entity framework core.To add a model or poco class in visual studio

1:- Right click on project in visual studio and add a new folder “Model”

2:- Then add a new class Student in it

using System;
using System.ComponentModel.DataAnnotations;

namespace RazorPagesMovie.Models
{
    public class Movie
    {
        public int ID { get; set; }
        public string Name{ get; set; }

        [DataType(DataType.Date)]
        public DateTime DOB{ get; set; }
        public string Genre { get; set; }
        public decimal Fee{ get; set; }
    }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *