Exemplo n.º 1
0
        public async Task AddNewCategoryAsync(ITableCategory category, TaskContext context)
        {
            var authentication = context.Authentication;
            var categoryNanme  = RandomUtility.NextIdentifier();

            if (context.AllowException == false)
            {
                if (category.GetAccessType(authentication) < AccessType.Master)
                {
                    return;
                }
            }
            await category.AddNewCategoryAsync(authentication, categoryNanme);
        }
        public static async Task <ITableCategory> AddNewCategoryAsync(this ITableCategory category, Authentication authentication)
        {
            var newName = NameUtility.GenerateNewName("Folder", category.Categories.Select(item => item.Name));

            return(await category.AddNewCategoryAsync(authentication, newName));
        }
Exemplo n.º 3
0
        public static async Task <ITableCategory> GenerateTableCategoryAsync(this ITableCategory tableCategory, Authentication authentication)
        {
            var name = await tableCategory.GenerateNewCategoryNameAsync();

            return(await tableCategory.AddNewCategoryAsync(authentication, name));
        }
Exemplo n.º 4
0
        public static Task <ITableCategory> AddRandomCategoryAsync(this ITableCategory category, Authentication authentication)
        {
            var categoryName = RandomUtility.NextName();

            return(category.AddNewCategoryAsync(authentication, categoryName));
        }