MVC - Model


  Translation results:

MVC is one of three ASP.NET programming patterns.

MVC is a pattern for creating Web applications using MVC (Model View Controller model-view-controller) design:

Model (model) represents the core of the application (such as a database record list).

View displays data (database records).

Controller handles input (writes database records).

MVC pattern provides full control over HTML, CSS and JavaScript simultaneously.

MVC - Modelsyntax

The MVC model contains all application logic (business logic, validation logic, data access logic) except pure view and controller logic.

With MVC, models can control and manipulate application data.

MVC - Modelexample

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace MvcDemo.Models
{
public class MovieDB
{
public int ID { get; set; }
public string Title { get; set; }
public string Director { get; set; }
public DateTime Date { get; set; }
}
public class MovieDBContext : DbContext
{
public DbSet<MovieDB> Movies { get; set; } 
}
}

Popular Recommendations

Home

Videos

Q&A