コード例 #1
0
        private List <CompositePropertyProjection> GetPropertyProjectionsForNonAggregateRoot(
            CompositeDefinitionProcessorContext processorContext,
            EmbeddedObject currentMember,
            IEnumerable <XElement> propertyElements,
            string containingElementName)
        {
            var selectedElements      = CompositeDefinitionHelper.CreateSelectedElements(propertyElements);
            var validPropertiesByName = CompositeDefinitionHelper.ValidPropertiesByName(processorContext, currentMember.ObjectType.PropertyByName);
            var validProperties       = CompositeDefinitionHelper.GetValidProperties(selectedElements, validPropertiesByName);

            ValidateSelectedElements(selectedElements, validProperties, containingElementName, processorContext.ShouldIncludeResourceSubtype());

            return(validProperties
                   .Select(pn => new CompositePropertyProjection(currentMember.ObjectType.AllPropertyByName[pn.Name], pn.DisplayName))
                   .ToList());
        }
コード例 #2
0
        private List <CompositePropertyProjection> GetPropertyProjections(
            CompositeDefinitionProcessorContext processorContext,
            IEnumerable <XElement> propertyElements)
        {
            var selectedElements = CompositeDefinitionHelper.CreateSelectedElements(propertyElements);

            // only allow identifying properties for pass through resources.
            var validPropertiesByName = CompositeDefinitionHelper.ValidPropertiesByName(
                processorContext, processorContext.CurrentResourceClass.AllPropertyByName);

            var validProperties = CompositeDefinitionHelper.GetValidProperties(selectedElements, validPropertiesByName);

            ValidateSelectedElements(
                selectedElements, validProperties,
                processorContext.CurrentElement.AttributeValue(CompositeDefinitionHelper.Name),
                processorContext.ShouldIncludeResourceSubtype());

            return(validProperties.Select(
                       pn =>
                       new CompositePropertyProjection(
                           processorContext.CurrentResourceClass.AllPropertyByName[pn.Name],
                           pn.DisplayName))
                   .ToList());
        }