0

I upgrade my project from .Net 4.5.2 to .Net 4.8.1 and of course nuget package "NEST" upgraded too.

In the NEST 7.X version we don't have anymore the next methods: GetRepository(), CreateRepository(), DeleteRepository().

How to use this methods if I really need to use this methods in my existing code?

var getRepositoryResponse = client.GetRepository(x => x.RepositoryName("repName"));
// client it's a ElasticClient object

I expected that after updating the new version of .NET Framework 4.8.1 I could use these methods again: GetRepository(), CreateRepository(), DeleteRepository()

Kanasi
  • 59
  • 2
  • 12
  • Looking at using statements at following sample code which uses Repository in Core : https://code-maze.com/net-core-web-development-part4/?force_isolation=true – jdweng Mar 23 '23 at 16:03
  • No @jdweng, GetRepository it was part of ElasticClient object, NEST team was delete this method and I don't know how to use this method or how change it – Kanasi Mar 23 '23 at 16:07
  • So they moved the library when the moved to Core. – jdweng Mar 23 '23 at 16:55
  • I found the answer! Developer team was moved this methods to Snapshop object. You must use this structure: `var getRepositoryResponse = client.Snapshot.GetRepository(x => x.RepositoryName("repName"));` – Kanasi Mar 24 '23 at 11:53

0 Answers0