internal static DatasetReference DeserializeDatasetReference(JsonElement element)
        {
            DatasetReferenceType type = default;
            string referenceName      = default;
            Optional <IDictionary <string, object> > parameters = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("type"))
                {
                    type = new DatasetReferenceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("referenceName"))
                {
                    referenceName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("parameters"))
                {
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetObject());
                    }
                    parameters = dictionary;
                    continue;
                }
            }
            return(new DatasetReference(type, referenceName, Optional.ToDictionary(parameters)));
        }
Пример #2
0
        public DatasetReference(DatasetReferenceType type, string referenceName)
        {
            if (referenceName == null)
            {
                throw new ArgumentNullException(nameof(referenceName));
            }

            Type          = type;
            ReferenceName = referenceName;
            Parameters    = new ChangeTrackingDictionary <string, object>();
        }
Пример #3
0
 internal DatasetReference(DatasetReferenceType type, string referenceName, IDictionary <string, object> parameters)
 {
     Type          = type;
     ReferenceName = referenceName;
     Parameters    = parameters;
 }