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)); }
public static async Task <ITableCategory> GenerateTableCategoryAsync(this ITableCategory tableCategory, Authentication authentication) { var name = await tableCategory.GenerateNewCategoryNameAsync(); return(await tableCategory.AddNewCategoryAsync(authentication, name)); }
public static Task <ITableCategory> AddRandomCategoryAsync(this ITableCategory category, Authentication authentication) { var categoryName = RandomUtility.NextName(); return(category.AddNewCategoryAsync(authentication, categoryName)); }