< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SqlConnection
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlConnection.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlConnection.Serialization.cs
Covered lines:0
Uncovered lines:57
Coverable lines:57
Total lines:143
Line coverage:0% (0 of 57)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Type()-0%100%
get_Name()-0%100%
get_AdditionalProperties()-0%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
TryGetValue(...)-0%100%
ContainsKey(...)-0%100%
get_Keys()-0%100%
get_Values()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_Count()-0%100%
Add(...)-0%100%
Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_IsReadOnly()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Clear()-0%100%
get_Item(...)-0%100%
set_Item(...)-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSqlConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlConnection.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections;
 10using System.Collections.Generic;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    /// <summary> The connection used to execute the SQL script. </summary>
 16    public partial class SqlConnection : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of SqlConnection. </summary>
 19        /// <param name="type"> The type of the connection. </param>
 20        /// <param name="name"> The identifier of the connection. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 022        public SqlConnection(SqlConnectionType type, string name)
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 28
 029            Type = type;
 030            Name = name;
 031            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 032        }
 33
 34        /// <summary> Initializes a new instance of SqlConnection. </summary>
 35        /// <param name="type"> The type of the connection. </param>
 36        /// <param name="name"> The identifier of the connection. </param>
 37        /// <param name="additionalProperties"> . </param>
 038        internal SqlConnection(SqlConnectionType type, string name, IDictionary<string, object> additionalProperties)
 39        {
 040            Type = type;
 041            Name = name;
 042            AdditionalProperties = additionalProperties;
 043        }
 44
 45        /// <summary> The type of the connection. </summary>
 046        public SqlConnectionType Type { get; set; }
 47        /// <summary> The identifier of the connection. </summary>
 048        public string Name { get; set; }
 049        internal IDictionary<string, object> AdditionalProperties { get; }
 50        /// <inheritdoc />
 051        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 52        /// <inheritdoc />
 053        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 54        /// <inheritdoc />
 055        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 56        /// <inheritdoc />
 057        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 58        /// <inheritdoc />
 059        public ICollection<string> Keys => AdditionalProperties.Keys;
 60        /// <inheritdoc />
 061        public ICollection<object> Values => AdditionalProperties.Values;
 62        /// <inheritdoc />
 063        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 64        /// <inheritdoc />
 065        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 66        /// <inheritdoc />
 067        public bool Remove(string key) => AdditionalProperties.Remove(key);
 68        /// <inheritdoc />
 069        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 70        /// <inheritdoc />
 071        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 72        /// <inheritdoc />
 073        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 74        /// <inheritdoc />
 075        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 76        /// <inheritdoc />
 077        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 78        /// <inheritdoc />
 079        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 80        /// <inheritdoc />
 81        public object this[string key]
 82        {
 083            get => AdditionalProperties[key];
 084            set => AdditionalProperties[key] = value;
 85        }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SqlConnection.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    public partial class SqlConnection : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("type");
 020            writer.WriteStringValue(Type.ToString());
 021            writer.WritePropertyName("name");
 022            writer.WriteStringValue(Name);
 023            foreach (var item in AdditionalProperties)
 24            {
 025                writer.WritePropertyName(item.Key);
 026                writer.WriteObjectValue(item.Value);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static SqlConnection DeserializeSqlConnection(JsonElement element)
 32        {
 033            SqlConnectionType type = default;
 034            string name = default;
 035            IDictionary<string, object> additionalProperties = default;
 036            Dictionary<string, object> additionalPropertiesDictionary = default;
 037            foreach (var property in element.EnumerateObject())
 38            {
 039                if (property.NameEquals("type"))
 40                {
 041                    type = new SqlConnectionType(property.Value.GetString());
 042                    continue;
 43                }
 044                if (property.NameEquals("name"))
 45                {
 046                    name = property.Value.GetString();
 047                    continue;
 48                }
 049                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 050                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 51            }
 052            additionalProperties = additionalPropertiesDictionary;
 053            return new SqlConnection(type, name, additionalProperties);
 54        }
 55    }
 56}