Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non generic type Fields can not be used with type argument #7985

Closed
a2741890 opened this issue Nov 16, 2023 · 3 comments
Closed

Non generic type Fields can not be used with type argument #7985

a2741890 opened this issue Nov 16, 2023 · 3 comments
Labels
7.x Relates to a 7.x client version

Comments

@a2741890
Copy link

a2741890 commented Nov 16, 2023

NEST/Elasticsearch.Net version: 7.16.0

Elasticsearch version: 7.16.0

.NET runtime version: .NET 6.0

Operating system version: Windows 10

I tried to use the example from the page (Object Initializer syntax example) But there was an error saying "Non generic type Fields can not be used with type argument" for the usage "Field = Field(p => p.Tags.First().Added)"

Seems like the Field is not accepting generic type...
Very confused

image

@a2741890 a2741890 added the 7.x Relates to a 7.x client version label Nov 16, 2023
@a2741890
Copy link
Author

a2741890 commented Nov 16, 2023

Ok I think I found the correct syntax. According to the test , you have to call the static method Infer in order to use generic Field.
e.q.
Field = Infer.Field<Project>(f => f.LocationPoint),
So I assume the document mentioned above is wrong?

@flobernd
Copy link
Member

Hi @a2741890 , yes I assume it's outdated 🙂

@a2741890
Copy link
Author

Hi @a2741890 , yes I assume it's outdated 🙂

🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.x Relates to a 7.x client version
Projects
None yet
Development

No branches or pull requests

2 participants