Exemplo n.º 1
0
        public SqlPoolReference(SqlPoolReferenceType type, string referenceName)
        {
            if (referenceName == null)
            {
                throw new ArgumentNullException(nameof(referenceName));
            }

            Type          = type;
            ReferenceName = referenceName;
        }
Exemplo n.º 2
0
        internal static SqlPoolReference DeserializeSqlPoolReference(JsonElement element)
        {
            SqlPoolReferenceType type = default;
            string referenceName      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("type"))
                {
                    type = new SqlPoolReferenceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("referenceName"))
                {
                    referenceName = property.Value.GetString();
                    continue;
                }
            }
            return(new SqlPoolReference(type, referenceName));
        }