Beispiel #1
0
        //[TaskMethod(Weight = 10)]
        public async Task AddAccessMemberAsync(ITable table, TaskContext context)
        {
            var authentication = context.Authentication;

            if (context.AllowException == false)
            {
                if (await table.Dispatcher.InvokeAsync(() => table.IsPrivate) == false)
                {
                    return;
                }
            }
            var userContext = table.GetService(typeof(IUserContext)) as IUserContext;
            var memberID    = await userContext.Dispatcher.InvokeAsync(() => userContext.Select(item => item.Path).Random());

            var accessType = RandomUtility.NextEnum <AccessType>();
            await table.AddAccessMemberAsync(authentication, memberID, accessType);
        }