I have an SqLite db which have category table. Category table has 3 columns, Id: int, name: varchar, and ObjectID: int
I wrote entity for this table:
class Category
{
public int Id { get; set; }
public string Name { get; set; }
public int ObjectId { get; set; }
}
and I also have a context:
class DEContext: DbContext
{
public DbSet<Category> Categories { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions
.Remove<PluralizingTableNameConvention>();
}
}
Now when I try to get categories with context.Categories I receive System.Data.SQLite.SQLiteException
:
SQL logic error or missing database\r\nno such column: Extent1.Object_Id
The query looks like:
SELECT
[Extent1].[Id] AS [Id],
[Extent1].[Name] AS [Name],
[Extent1].[ObjectId] AS [ObjectId],
[Extent1].[Object_Id] AS [Object_Id]
FROM [Category] AS [Extent1]} System.Data.Entity.DbSet<Category>
I don't know where the Object_Id is from. I don't have such column in db and I don't use such name in my whole project.
I use System.Data.SQLite