private static Activitypointerrecords GenerateActivitypointerNode(Sdk.Entity entity, BuilderEntityMetadata builderEntityMetadata)
        {
            var ActivitypointerNode = new DataXml.Activitypointerrecords
            {
                Id    = entity.Id.ToString(),
                Field = new List <DataXml.Field>()
            };

            foreach (var attribute in entity.Attributes)
            {
                ActivitypointerNode.Field.Add(GenerateFieldNode(attribute, Builders.ActivityPartyMetadata.Build().Attributes.Where(a => a.LogicalName.Equals(attribute.Key)).First(), builderEntityMetadata));
            }

            return(ActivitypointerNode);
        }
Ejemplo n.º 2
0
        private static IList <Sdk.Entity> BuildActivityPartyList(DataXml.Field field, SchemaXml.Entity schemaData)
        {
            var activityParties = new List <Sdk.Entity>();

            foreach (var record in field.Activitypointerrecords)
            {
                var party = new Sdk.Entity("activityparty", Guid.Parse(record.Id));
                foreach (var attribute in record.Field)
                {
                    party[attribute.Name] = GetActivityPartyObjectFromFieldNodeType(attribute, schemaData);
                }
                activityParties.Add(party);
            }

            return(activityParties);
        }
        private static DataXml.Record GenerateRecordNode(Sdk.Entity entity, BuilderEntityMetadata builderEntityMetadata)
        {
            var RecordNode = new DataXml.Record
            {
                Id    = entity.Id.ToString(),
                Field = new List <DataXml.Field>()
            };

            foreach (var attribute in entity.Attributes)
            {
                var attributeMetadata = builderEntityMetadata.Metadata.Attributes.Where(a => a.LogicalName.Equals(attribute.Key)).First();

                if (!IsSupportedAttributeType(attributeMetadata.AttributeType))
                {
                    continue;
                }

                RecordNode.Field.Add(GenerateFieldNode(attribute, attributeMetadata, builderEntityMetadata));
            }

            RecordNode.Field.Sort((x, y) => string.Compare(x.Name, y.Name));

            return(RecordNode);
        }