Exemple #1
0
        public virtual void MapFrom(IReadOnlyDictionary <string, object?> properties)
        {
            bool hasUnidentifiedProperties = (Wrapper.GetEntity().InheritedUnidentifiedProperties() is not null);

            if (hasUnidentifiedProperties)
            {
                if (UnidentifiedProperties is null)
                {
                    UnidentifiedProperties = new UnidentifiedPropertyCollection(Wrapper);
                }
                else
                {
                    UnidentifiedProperties.ClearInternal();
                }
            }
            foreach (KeyValuePair <string, object?> property in properties)
            {
                PropertyDetail?info;
                if (PropertyDetails.TryGetValue(property.Key, out info))
                {
                    info.SetValue(this, property.Value);
                }
                else
                if (UnidentifiedProperties is not null)
                {
                    UnidentifiedProperties.AddInternal(property.Key, property.Value);
                }
            }
        }
 public UnidentifiedPropertyCollection(UnidentifiedPropertyCollection source)
 {
     Parent = source.Parent;
     foreach (KeyValuePair <string, object?> item in source.UnidentifiedBacking)
     {
         AddInternal(item.Key, item.Value);
     }
 }
Exemple #3
0
        public void Initialize(OGM parent)
        {
            if (wrapper is not null)
            {
                throw new NotSupportedException("You should not call this method... Leave it to the professionals... Greetzz from the A Team.");
            }

            wrapper = parent;
            InitializeCollections();

            if (wrapper.GetEntity().InheritedUnidentifiedProperties() is not null)
            {
                UnidentifiedProperties = new UnidentifiedPropertyCollection(Wrapper);
            }
        }