F# immutable Records do not work
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
The following record does not work in EF Core:
```fsharp
type Todo = { Id: Guid; Title: string }
```
```
System.InvalidOperationException: No suitable constructor was found for entity type 'Todo'. The following constructors had parameters that could not be bound to properties of the entity type:
Cannot bind 'id', 'title' in 'Todo(Guid id, string title)'
Note that only mapped properties can be bound to constructor parameters. Navigations to related entities, including references to owned types, cannot be bound.
```
If you put the `[]` attribute on (which compiles the record with mutable properties and a default ctor) then it works. However, this is non-obvious and normal records should "just work" with EF.
Contributor guide
Assessment
This issue has not been assessed yet.