DdeM
April 19, 2024, 1:58pm
1
Using the .Net client for elasticsearch I can do all actions using a generic contstraint, eg.
return _client.DeleteAsync<T>(id, cancellationToken);
However, when I want to edit a document this doesn't work. Is there a reason for this or am I overlooking something?
eg. I would expect this to use the default mapping for T:
return _client.UpdateAsync<T>(indexName, id, configureRequest, cancellationToken);
1 Like
flobernd
(Florian Bernd)
April 20, 2024, 8:14pm
2
1 Like
DdeM
April 22, 2024, 10:31am
3
@flobernd Sounds like it indeed. Would be awesome if that can be fixed Makes testing a lot easier if I can configure an index name in one place
flobernd
(Florian Bernd)
April 22, 2024, 11:05am
4
@DdeM
Fixed in Generate inference constructor overloads by flobernd · Pull Request #8153 · elastic/elasticsearch-net · GitHub
Will be included in the next patch release (today or tomorrow).
Just note, that Update
requires 2 generic type arguments like Update<TDocument, TPartialDocument>(...)
.
1 Like