Category "ef-code-first"

Running EF core command 'update database' in .NET core 2.2 app is applying an old migration instead of the current one

I'm working on a .NET Core version 2.2 app (with Angular), which uses EF Core (code first). It's been an existing project for a few years, I've cloned it about

An operation was scaffolded that may result in the loss of data. Please review the migration for accuracy. happens after Update-database has no change

I performed an Update-database command and received the message that there were no changes and the database was up to date. Then after subsequently issuing the

EF Core: Map Many to Many relationship without navigation property

I'm trying to create a many to many relationship in entity Framework Core using Fluent API Here is my first model: MyCalculationSelector.cs public int Sort

The corresponding CLR type for entity type 'Employee' is not instantiable

My error: The corresponding CLR type for entity type 'Employee' is not instantiable and there is no derived entity type in the model that corresponds to a conc

Error adding migration when data models are in a separate assembly

I've just setup new projects, Pegasus (my main web application) and PegasusEntities (my database objects). My Pegasus start-up code includes the following. buil

SQLite Error 14: 'unable to open database file' with EF Core code first

I am getting an SQLite Error 14: 'unable to open database file' with EF Core code first, no idea why. I worked fine the first time, the database file got crea

Getting the result of a computed column from database into an entity

In a project using Entity Framework, say I have an entity such as [Table("MyTable")] public partial class MyTable { public string FirstName { get; set; }

Unable to update database to match the current model because there are pending changes

I have a project built in visual studio 2013 environment with the Db built using EF 5 code first. I have had my APIs working fine for a long time but all of a

Code first migration error "Implicit conversion from data type nvarchar(max) to varbinary(max) is not allowed"

I changed the data type of a field in my model from string to byte array and I got this error when I run Update-Database code first migration method. Implic

Add new Required Field to one of table with EF Code First Migration

I am using EF Code First Migration. I already have lots of data on production Db and I would like to intorduce a non nullable field. How it could be possible?

The type 'Company.Model.User' and the type 'Company.Core.Model.User' both have the same simple name of 'User' and so cannot be used in the same model

I have a base entity class MyCompany.Core.Model.User which is to be used for common properties of a User entity: public class User { public string Username