Link to home
Start Free TrialLog in
Avatar of vgruppo
vgruppoFlag for Italy

asked on

Entity Framework Code First

Hi,

I'm trying to write my first project for Entity Data Model with Code First approach.

My project is composed in 3 part:

EFDemo a console project
Demo.data a class library about my object model
Demo.dataAccess a class library  about my DbContext

The error viewable in the image attached, is not understandable for me.
Please  suggest me where to find the trouble

Thanks




namespace Demo.Data
{
    public class Attendee
    {
        [Key]
        private int AttendeeID { get; set; }
       
        [StringLength(50)]
        private string LastName { get; set; }

        private DateTime DateAddeted { get; set; }


    }
}

namespace Demo.DataAccess
{
    public class CodeContext : DbContext
    {
        public CodeContext() :
            base("Server=.;Database=CodeStock;Trusted_Connection=true")
        {      
   
        }    

        public DbSet<Attendee> Attendees { get; set; }
    }
} User generated image
ASKER CERTIFIED SOLUTION
Avatar of Irzana
Irzana
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial