Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Controller Scaffolding in MVC 5

$
0
0

Hi,

I am developing an application using mvc 5 in Visual Studio 2012. I have successfully build my model class.

My Model class:

using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace NewMvcDemo.Models
{
    public class User
    {
        [Key]
        public int ID { get; set; }
        public string  Name { get; set; }
        public string City { get; set; }
        public string Company { get; set; }
    }

    public class UserDbContext : DbContext
    {
        public DbSet<User> NewUser { get; set; }
    }
}


When i want to add a New Scaffolded item in controller , the following error occur:

 


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>