Esempio n. 1
0
        private static async Task DeleteUserDefinedFunctions(IDocumentClient client, Uri collectionUri)
        {
            Console.WriteLine("Deleting user defined functions");
            IEnumerable <UserDefinedFunction> userDefinedFunctions = client.CreateUserDefinedFunctionQuery(collectionUri).AsEnumerable();

            foreach (UserDefinedFunction userDefinedFunction in userDefinedFunctions)
            {
                await client.DeleteUserDefinedFunctionAsync(userDefinedFunction.SelfLink);
            }
        }
        private static void ViewUserDefinedFunctions(IDocumentClient client)
        {
            Console.WriteLine();
            Console.WriteLine(">>> View UDFs <<<");
            Console.WriteLine();

            List <UserDefinedFunction> udfs = client
                                              .CreateUserDefinedFunctionQuery(MyStoreCollectionUri)
                                              .ToList();

            foreach (UserDefinedFunction udf in udfs)
            {
                Console.WriteLine($" User defined function {udf.Id}; RID: {udf.ResourceId}");
            }
        }