I have an index:
public class TotalsIndex<TClass> : AbstractIndexCreationTask<TClass, Totals> where TClass : class, IClass
I get an error: Cannot create an instance of Raven.Client.Documents.Indexes.AbstractIndexCreationTask1[TDocument] because Type.ContainsGenericParameters is true.'`
when use IndexCreation.CreateIndexes(assembly, store);
Is it possible to create RavenDB map-reduce index that contains generic type via IndexCreation.CreateIndexes?
On the other hand new TotalsIndex<TClass>().Execute(documentStore); works
The common way to define a Map or a Map-Reduce index is without the generic on the index class name.
e.g., see this Map-Reduce index example:
(taken from https://demo.ravendb.net/demos/csharp/static-indexes/map-reduce-index)
You can then deploy the index by:
or by:
or - as you wanted - by:
or by:
Sending a
PutIndexesOperationon the storeSee Creating & Deploying:
https://ravendb.net/docs/article-page/6.0/csharp/indexes/creating-and-deploying