I am just trying to enable migration in entity framework code first approach. I am working on AirlineManagementSystem.
I have created a class Plane.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
namespace AirlineticketSystem.Models
{
public class Plane
{
[Key]
public int Plane_id { get; set; }
public string Plane_Name { get; set; }
public string Plane_No { get; set; }
public string Plane_BClass { get; set; }
public string Plane_EClass { get; set; }
public List<User> Users { get; set; }
}
}
Now I have created a class User
using System.ComponentModel.DataAnnotations;
namespace AirlineticketSystem.Models
{
public class User {
public int userid { get; set; }
public string user_name { get; set; }
public string user_fname { get; set; }
public string usercnic { get; set; }
public string user_passport { get; set; }
public string user_bloodGp { get; set; }
public string user_nationality { get; set; }
public string usertype { get; set; }
public string status { get; set; }
public int mobilenumber { get; set; }
public string gender { get; set; }
public int Plane_id { get; set; }
public Plane Plane { get; set; }
}
}
So One Plane can have many Users.
Please let me know how can I enable migration in the Package Manage Console??