Skip to content

Marten.Exceptions.InvalidDocumentException: Could not determine an 'id/Id' field or property for requested document type System.Linq.IGrouping`2[[System.String, System.Private.CoreLib #2435

Answered by mysticmind
borgez asked this question in General
Discussion options

You must be logged in to vote

@borgez Please check docs https://martendb.io/documents/identity.html#document-identity.

Marten's only other requirement for a .Net type to be a document is the existence of an identifier field or property that Marten can use as the primary key for the document type. The Id can be either a public field or property, and the name must be either id or Id or ID.

If you want to use a different property name as identifier then check https://martendb.io/documents/identity.html#overriding-the-choice-of-id-property-field

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mysticmind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants
Converted from issue

This discussion was converted from issue #2395 on December 22, 2022 04:03.