Пример #1
0
        public static bool ChangeColumn(this ITableTemplate template, Authentication authentication)
        {
            var column = template.RandomOrDefault();

            if (column == null)
            {
                return(false);
            }

            if (RandomUtility.Within(25) == true)
            {
                column.SetName(authentication, RandomUtility.NextIdentifier());
            }

            if (RandomUtility.Within(75) == true)
            {
                column.SetTags(authentication, TagInfo.All);
            }
            else
            {
                column.SetTags(authentication, tags.Random());
            }

            if (RandomUtility.Within(25) == true)
            {
                column.SetComment(authentication, RandomUtility.NextString());
            }

            return(true);
        }
Пример #2
0
        public static bool DeleteColumn(this ITableTemplate template, Authentication authentication)
        {
            var column = template.RandomOrDefault();

            if (column == null || column.IsKey == true)
            {
                return(false);
            }

            try
            {
                column.Delete(authentication);
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Пример #3
0
        public static async Task <bool> DeleteColumnAsync(this ITableTemplate template, Authentication authentication)
        {
            var column = template.RandomOrDefault();

            if (column == null || column.IsKey == true)
            {
                return(false);
            }

            try
            {
                await column.DeleteAsync(authentication);
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Пример #4
0
 public static async Task ModifyRandomColumnAsync(this ITableTemplate template, Authentication authentication)
 {
     var column = template.RandomOrDefault();
     await column?.ModifyRandomValueAsync(authentication);
 }
Пример #5
0
 public static async Task RemoveRandomColumnAsync(this ITableTemplate template, Authentication authentication)
 {
     var column = template.RandomOrDefault();
     await column?.DeleteAsync(authentication);
 }
Пример #6
0
        public static void ModifyRandomColumn(this ITableTemplate template, Authentication authentication)
        {
            var column = template.RandomOrDefault();

            column?.ModifyRandomValue(authentication);
        }
Пример #7
0
        public static void RemoveRandomColumn(this ITableTemplate template, Authentication authentication)
        {
            var column = template.RandomOrDefault();

            column?.Delete(authentication);
        }