public async Task EnumerateDatabases() { try { ErrorMessage = ""; Status = ConnectionStatus.GettingDatabases; var context = new Data.SchemaDBContext(this); var contextGetDatabases = await Data.SchemaDBContext.GetDatabases(this); Databases.Clear(); foreach (var item in contextGetDatabases) { item.IsSelected = true; this.Databases.Add(item); } } catch (Exception e) { ErrorMessage = e.ToString(); } finally { Status = ConnectionStatus.Dormant; } }
private async static Task <ScriptedObjectInfo> GetScriptedObject(DBObjectViewModel vm) { var ctx = new Data.SchemaDBContext(vm.ConnectionViewModel); var objectDefinition = await ctx.GetObjectDefinition(vm.SysObject); var scriptedInfo = new ScriptedObjectInfo(objectDefinition, vm.SysObject); return(scriptedInfo); }