So, I'm fairly new to MVC, and just started following several tutorials on DotNetCurry, more specifically this one but I'm facing this problem that it's already answered
But the answer to it isn't working for me. Here's the context of my test project
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace Sysbat.Models
{
public class SysbatContext : DbContext
{
public DbSet<Objeto> Objetos { get; set; }
public DbSet<Propiedad> Propeidades { get; set; }
public DbSet<ObjetoPropiedades> ObjetosPropiedades { get; set; }
public DbSet<ObjetoValores> ObjetosValores { get; set; }
public DbSet<PropiedadValores> PorpiedadesValores { get; set; }
public SysbatContext() : base("DevConn"){}
}
}
Any idea why I'm also getting the Unable to cast object of type 'System.Data.Entity.Core.Objects.ObjectContext' to 'System.Data.Objects.ObjectContext'
when adding a control?
I didn't wanted to raise the dead, as this answer is rom last year, that's why I'm posting a new question.
Update 1:
After further research, I found out this it's not possible using EF 6.1, which I what I was using, and it was either upgrade to mvc 5 or downgrade to EF 5. Given that I'm using VS2010 (my laptop can't handle VS2012 or newer, need to upgrade, XD) MVC 5 its not an option, so I uninstalled EF 6 and installed 5, now, I'm getting another error
Unable to retrieve metadata for 'Sysbat.Models.Objeto'.
Unrecognized element 'providers'.
Here's the class 'Objeto' I'm trying to create the control to
/// <summary>
/// Class that hold the Objetos to be used in the system
/// </summary>
public class Objeto
{
[Key]
public int Oid { get; set; }
public string Nombre { get; set; }
public DateTime FechaCreacion { get; set; }
}