Beispiel #1
0
        public SqlScriptResource(string name, SqlScript properties)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Name       = name;
            Properties = properties;
        }
Beispiel #2
0
        internal static SqlScriptResource DeserializeSqlScriptResource(JsonElement element)
        {
            SqlScript         properties = default;
            Optional <string> etag       = default;
            Optional <string> id         = default;
            Optional <string> name       = default;
            Optional <string> type       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = SqlScript.DeserializeSqlScript(property.Value);
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
            }
            return(new SqlScriptResource(id.Value, name.Value, type.Value, etag.Value, properties));
        }
Beispiel #3
0
 internal SqlScriptResource(string id, string name, string type, string etag, SqlScript properties) : base(id, name, type, etag)
 {
     Properties = properties;
 }