'Entity Framework code-first - adding a column that already exists in the database
I am using .NET Core 3.1.2 and Entity Framework Core 3.1.2.
Approach is code first, but I have one column in my SQL Server table that already exists (Country), and I don't have it in the entity class.
So I have added a plain string property
public string Country { get; set; }
Now, when I try to save this table (e.g. customer) I get an error:
Invalid column name Customer_Country
I cannot create migration because the column already exists; is there a solution for this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
