I have created a context of Entity Framework like below: using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace UniversityApp.Models
{
public class ProfDb : DbContext
{
public DbSet<Professor> Professors { get; set; }
public DbSet<Student> Students { get; set; }
}
}
I am using VS 2015 Professional. Then I go to View=>Server Explorer=> Add Connection=> Microsoft Sql Server => In Data Source I choose (LocalDb)\MSSQLLocalDB , and when I go to select a database name I do not find UniversityApp.Models.ProfDb as an option. I have also created a new object of ProfDb in one of my controller but still not working. Should anyone tell me why mapping is not working in my application and what I should do?
Try this, Go to Web config, search for
Add this