Unable to retrive metadata for 'pos.Model.Semester'. Unable to cast objectof type 'System.Data.Entity.Core.Objects.ObjectContext' to type 'System.Data.Objects.ObjectContext'
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace pos.Models { public class Semester { [Key] public int SemesterId { get; set; } [Required] [MaxLength(30)] public string SemesterName { get; set; } public int Status { get; set; } } }
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; namespace pos.Models { public class SemesterContext : DbContext { public SemesterContext() : base("name=pos") { } public DbSet<Semester> Semesters { get; set; } } }
<connectionStrings> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-pos-20150527182631;Integrated Security=SSPI;" providerName="System.Data.SqlClient" /> <add name="pos" connectionString="Data Source=AZIZ;Initial Catalog=PointofSell;User ID=sa; Password=mdazizulhoque.bd1987" providerName="System.Data.SqlClient" /> </connectionStrings>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)