コード例 #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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public static async Task <ITableCategory> GenerateTableCategoryAsync(this ITableCategory tableCategory, Authentication authentication)
        {
            var name = await tableCategory.GenerateNewCategoryNameAsync();

            return(await tableCategory.AddNewCategoryAsync(authentication, name));
        }
コード例 #4
0
        public static Task <ITableCategory> AddRandomCategoryAsync(this ITableCategory category, Authentication authentication)
        {
            var categoryName = RandomUtility.NextName();

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