Ejemplo n.º 1
0
        internal static async Task Clear(IArangoDatabase db, string collectionName, CollectionType type = CollectionType.Document)
        {
            if ((await db.ListCollectionsAsync()).Any(c => c.Name == collectionName))
            {
                await db.DropCollectionAsync(collectionName);
            }

            await db.CreateCollectionAsync(collectionName, type : type);
        }
Ejemplo n.º 2
0
        public static Task <CreateCollectionResult> CreateCollectionAsync <T>(this IArangoDatabase db)
        {
            var collectionName = db.SharedSetting.Collection.ResolveCollectionName <T>();

            return(db.CreateCollectionAsync(collectionName));
        }