Elegant way to determine whether a view exists? (.NET SDK)
Mon, 11/26/2012 - 09:35
I'm having a problem finding an elegant solution to this issue. I've discovered that you can find out that a view doesn't exist when you try to perform a query after attempting to retrieve the view:
var result = _couchClient.GetView<etc>("DocumentName", "ViewNameThatDoesNotExist");<br></etc><etc>result.Count(); // This returns a service exception </etc>
Count throws an exception, so at the moment I use a try/catch to determine if there is an exception. Is there a more elegant solution that doesn't require as many resources as performing a query? There doesn't seem to be anything like result.Exists() or something similar.
Thanks!