Esempio n. 1
0
        internal static TransformFunction TransformFor(this ITenant tenant, string transformName)
        {
            try
            {
                var schema = tenant.FindFeature(typeof(TransformSchema));
                if (schema == null)
                {
                    throw new InvalidOperationException(
                              $"Attempting to use a PLV8/Javascript related feature, but the support is not active in this DocumentStore. Did you forget to call {nameof(StoreOptions)}.{nameof(StoreOptionsExtensions.UseJavascriptTransformsAndPatching)}()?");
                }

                return(schema.As <TransformSchema>().For(transformName));
            }
            catch (InvalidDocumentException)
            {
                throw new InvalidOperationException(
                          $"Attempting to use a PLV8/Javascript related feature, but the support is not active in this DocumentStore. Did you forget to call {nameof(StoreOptions)}.{nameof(StoreOptionsExtensions.UseJavascriptTransformsAndPatching)}()?");
            }
        }
Esempio n. 2
0
 public IFeatureSchema FindFeature(Type storageType)
 {
     return(_inner.FindFeature(storageType));
 }