Ejemplo n.º 1
0
 private static async Task SetFieldsAsync(Authentication authentication, JsonColumnInfos.ItemInfo item, ITableColumn column)
 {
     if (column.Name != item.Name)
     {
         await column.SetNameAsync(authentication, item.Name);
     }
     if (column.DataType != item.DataType)
     {
         await column.SetDataTypeAsync(authentication, item.DataType);
     }
     if (column.Comment != item.Comment)
     {
         await column.SetCommentAsync(authentication, item.Comment);
     }
     if (column.Tags != (TagInfo)item.Tags)
     {
         await column.SetTagsAsync(authentication, (TagInfo)item.Tags);
     }
     if (column.IsReadOnly != item.IsReadOnly)
     {
         await column.SetIsReadOnlyAsync(authentication, item.IsReadOnly);
     }
     if (column.IsUnique != item.IsUnique)
     {
         await column.SetIsUniqueAsync(authentication, item.IsUnique);
     }
     if (column.AutoIncrement != item.AutoIncrement)
     {
         await column.SetAutoIncrementAsync(authentication, item.AutoIncrement);
     }
     if (column.DefaultValue != item.DefaultValue)
     {
         await column.SetDefaultValueAsync(authentication, item.DefaultValue);
     }
     if (column.AllowNull != !item.DisallowNull)
     {
         await column.SetAllowNullAsync(authentication, !item.DisallowNull);
     }
 }
Ejemplo n.º 2
0
        private static async Task <JsonColumnInfos.ItemInfo> InitializeFieldsAsync(Authentication authentication, JsonColumnInfos.ItemInfo item, ITableColumn column)
        {
            await column.SetNameAsync(authentication, item.Name);

            await column.SetDataTypeAsync(authentication, item.DataType);

            await column.SetCommentAsync(authentication, item.Comment);

            await column.SetTagsAsync(authentication, (TagInfo)item.Tags);

            await column.SetIsReadOnlyAsync(authentication, item.IsReadOnly);

            await column.SetIsUniqueAsync(authentication, item.IsUnique);

            await column.SetAutoIncrementAsync(authentication, item.AutoIncrement);

            await column.SetDefaultValueAsync(authentication, item.DefaultValue);

            await column.SetAllowNullAsync(authentication, !item.DisallowNull);

            return(item);
        }
Ejemplo n.º 3
0
 public async Task SetTagsAsync(ITableColumn column, TaskContext context)
 {
     var authentication = context.Authentication;
     var tags           = (TagInfo)TagInfoUtility.Names.Random();
     await column.SetTagsAsync(authentication, tags);
 }