Пример #1
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Factory Methods
        public static DomAttribute CreateFromApiResource(IAttributeInfo attributeInfo, IGetAttributes apiGetAttributes)
        {
            Contract.Requires(attributeInfo != null);
            Contract.Requires(apiGetAttributes != null);

            var apiAttribute    = attributeInfo.GetApiAttribute(apiGetAttributes);
            var apiPropertyName = attributeInfo.ApiPropertyName;

            var clrPropertyType = attributeInfo.ClrPropertyType;
            var clrPropertyName = attributeInfo.ClrPropertyName;
            var clrAttribute    = apiAttribute.ToClrObject(clrPropertyType);

            var domAttribute = new DomAttribute(apiAttribute, apiPropertyName, clrAttribute, clrPropertyName, clrPropertyType);

            return(domAttribute);
        }