The Problem is that my model and context class don't show in options the computer says no model class
Template
MVC controller with read/write actions and views, using Entity Framework
Model class
No Model classes are available
Data context Class do not have any option
EmpModel.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace FileUploadDownLoadInMVC.Models
{
public class EmpModel
{
public HttpPostedFileBase files { get; set; }
}
public class FileDetailsModel
{
public int Id { get; set; }
public String FileName { get; set; }
public byte[] FileContent { get; set; }
public virtual ICollection<empmodel> File { get; set; }
}
}
dbcon.cs
using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace FileUploadDownLoadInMVC.Models
{
public class dbcon : DbContext
{
public dbcon() : base("dbcon")
{
}
public DbSet<empmodel> File { get; set; }
public DbSet<filedetailsmodel> Details { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
// modelBuilder.Conventions.Remove<pluralizingtablenameconvention>();
}
}
}
web.config
<connectionStrings>
<add name="dbcon"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\university.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
What I have tried:
i have made my model class and DBContext class and web.conf but i want to make controller and view for the following model using my model and DBcontext class they dont show in model when i add controller .