dotnet / dotnet/EntityFramework.Docs
Clarify that computed columns (and similar facets) must exist in the database schema
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
I was trying to use HasComputedColumnSql without migrations enabled, it didn't work. Found this SO post https://stackoverflow.com/questions/39306020/computed-column-in-ef-core-incorrect-mapping
which says that computed columns are only supported when migrations are enabled.
In my case HasComputedColumnSql is ignored and actual column name is used instead.
IMHO it makes sense to update documentation and make it clear when this option is supported
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 5d48c064-a896-af4b-9a32-7846e848bb9e
* Version Independent ID: 7d134bc7-7c34-a829-2a56-9ad6ea37015c
* Content: [Computed Columns - EF Core](https://docs.microsoft.com/en-us/ef/core/modeling/relational/computed-columns)
* Content Source: [entity-framework/core/modeling/relational/computed-columns.md](https://github.com/aspnet/EntityFramework.Docs/blob/master/entity-framework/core/modeling/relational/computed-columns.md)
* Product: **entity-framework**
* GitHub Login: @rowanmiller
* Microsoft Alias: **divega**
Contributor guide
Assessment
This issue has not been assessed yet.