SqlDatabase IOperationSource <SqlDatabase> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = SqlDatabaseData.DeserializeSqlDatabaseData(document.RootElement);

            return(new SqlDatabase(_armClient, data));
        }
        internal static DatabaseListResult DeserializeDatabaseListResult(JsonElement element)
        {
            Optional <IReadOnlyList <SqlDatabaseData> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <SqlDatabaseData> array = new List <SqlDatabaseData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SqlDatabaseData.DeserializeSqlDatabaseData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new DatabaseListResult(Optional.ToList(value), nextLink.Value));
        }
        public void Given()
        {
            var databaseData = new SqlDatabaseData(new ConnectionStringSettings
            {
                Name             = "myConnectionName",
                ConnectionString = "myConnectionString"
            },
                                                   new DictionaryConfigurationSource()
                                                   );

            registration = databaseData.GetRegistrations().First();
        }
        public void Given()
        {
            var databaseData = new SqlDatabaseData(new ConnectionStringSettings
                                                       {
                                                           Name = "myConnectionName",
                                                           ConnectionString = "myConnectionString"
                                                       },
                                                   new DictionaryConfigurationSource()
                );

            registration = databaseData.GetRegistrations().First();
        }