public async Task SetAllowNullAsync(ITableColumn column, TaskContext context) { var authentication = context.Authentication; var allowNull = RandomUtility.NextBoolean(); if (context.AllowException == false) { if (await column.Dispatcher.InvokeAsync(() => column.IsKey == true && allowNull == true) == true) { return; } } await column.SetAllowNullAsync(authentication, allowNull); }
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); } }
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); }