Esempio n. 1
0
        public static async Task AddRandomCategoriesAsync(this ITableContext tableContext, Authentication authentication, DataBaseSettings settings)
        {
            var minCount = settings.TableContext.MinTableCategoryCount;
            var maxCount = settings.TableContext.MaxTableCategoryCount;
            var count    = RandomUtility.Next(minCount, maxCount);
            var tableCategoryCollection = tableContext.GetService(typeof(ITableCategoryCollection)) as ITableCategoryCollection;

            while (await tableCategoryCollection.GetCountAsync() < count)
            {
                await tableContext.AddRandomCategoryAsync(authentication);
            }
        }