Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
Public Preview 1
-
None
Description
Hello, i'm using EF in my F#\C# project.
The model is simple:
[<CLIMutable>]
|
type EditorData = {
|
text:string
|
}
|
|
|
[<CLIMutable>]
|
type EditorBlock = {
|
id:string
|
``type``:string
|
data: EditorData
|
}
|
|
|
[<CLIMutable>]
|
type News = {
|
[<BsonId>]
|
[<BsonRepresentation(BsonType.Int32)>]
|
Id:int |
Category:int |
User:int |
Title:string
|
Slug:string
|
Added:DateTime
|
JsonContent:ResizeArray<EditorBlock>
|
}
|
i've saved my data and MongoDB Compass shows this:
{
|
"_id": 1, |
"Added": { |
"$date": "2024-01-17T14:21:55.412Z" |
},
|
"Category": 1, |
"Slug": "-", |
"Title": "Test News", |
"User": 1, |
"JsonContent": [ |
{
|
"id": "1FBsOgCe3H", |
"type": "paragraph", |
"data": { |
"text": "тестовый параграф" |
}
|
},
|
{
|
"id": "ZNptxV9d72", |
"type": "paragraph", |
"data": { |
"text": "ещё один" |
}
|
},
|
{
|
"id": "k_UNq6WE53", |
"type": "paragraph", |
"data": { |
"text": "third" |
}
|
}
|
]
|
}
|
if i try just to find record:
InvalidOperationException: The LINQ expression 'o' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. |
but if i remove data: EditorData from EditorBlock everything works
thank you for any help