Exemplo n.º 1
0
        //[TaskMethod(Weight = 10)]
        public async Task AddAccessMemberAsync(ITableCategory category, TaskContext context)
        {
            var authentication = context.Authentication;

            if (category.Parent == null)
            {
                return;
            }
            var userContext = category.GetService(typeof(IUserContext)) as IUserContext;
            var memberID    = await userContext.Dispatcher.InvokeAsync(() => userContext.Select(item => item.Path).Random());

            var accessType = RandomUtility.NextEnum <AccessType>();

            if (NameValidator.VerifyItemPath(memberID) == true)
            {
                await category.AddAccessMemberAsync(authentication, new ItemName(memberID).Name, accessType);
            }
            else
            {
                await category.AddAccessMemberAsync(authentication, memberID, accessType);
            }
        }