Пример #1
0
        public void Import(ServiceModelInfo serviceModelInfo)
        {
            foreach (var property in this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(c => c.GetCustomAttribute<ServiceAnnotationAttribute>() != null))
            {
                var value = property.GetValue(serviceModelInfo);

                if (value != null)
                {
                    property.SetValue(this, value);
                }
            }

            foreach (var value in this.ExtendedValues.Where(value => value.Value != null))
            {
                this.ExtendedValues[value.Key] = value.Value;
            }
        }