Reputation: 760
I keep getting an error saying: invalid column 'checked'. This is correct, because i have no column 'checked' in my database model. But i need it for filtering reasoning. Does anyone know how I can keep the checked property, but get rid off the error. I work with Entity Framework
namespace Entities
{
[MetadataType(typeof(FloorsMetadata))]
public partial class Floors
{
public bool checked { get; set; }
public static List<Floors> GetFloors(context db)
{
return db.Floors.ToList();
}
}
public class FloorsMetadata
{
[JsonIgnore]
public virtual ICollection<Building_Floors>Buildings_Floors { get; set; }
}
}
namespace Entities
{
public partial class Floors
{
public int id { get; set; }
[Required]
[StringLength(100)]
public string name { get; set; }
}
}
Upvotes: 1
Views: 30
Reputation: 7152
class StackOverfloContext : DbContext
{
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Floors>().Ignore(p => p.@checked);
}
}
class Floors
{
public string name { get; set; }
public bool @checked { get; set; }
}
Upvotes: 2