public virtual AttributeStateCreatedDto ToAttributeStateCreatedDto(IAttributeStateCreated e)
        {
            var dto = new AttributeStateCreatedDto();

            dto.StateEventId         = new AttributeStateEventIdDtoWrapper(e.StateEventId);
            dto.CreatedAt            = e.CreatedAt;
            dto.CreatedBy            = e.CreatedBy;
            dto.CommandId            = e.CommandId;
            dto.Name                 = e.Name;
            dto.OrganizationId       = e.OrganizationId;
            dto.Description          = e.Description;
            dto.IsMandatory          = e.IsMandatory;
            dto.IsInstanceAttribute  = e.IsInstanceAttribute;
            dto.AttributeValueType   = e.AttributeValueType;
            dto.AttributeValueLength = e.AttributeValueLength;
            dto.IsList               = e.IsList;
            dto.FieldName            = e.FieldName;
            dto.ReferenceId          = e.ReferenceId;
            dto.Active               = e.Active;
            var attributeValueEvents = new List <AttributeValueStateCreatedDto>();

            foreach (var ee in e.AttributeValueEvents)
            {
                AttributeValueStateCreatedDto eeDto = AttributeValueStateEventDtoConverter.ToAttributeValueStateCreatedDto(ee);
                attributeValueEvents.Add(eeDto);
            }
            dto.AttributeValueEvents = attributeValueEvents.ToArray();

            return(dto);
        }
Esempio n. 2
0
        public virtual AttributeStateDeletedDto ToAttributeStateDeletedDto(IAttributeStateDeleted e)
        {
            var dto = new AttributeStateDeletedDto();

            dto.AttributeEventId = e.AttributeEventId;
            dto.CreatedAt        = e.CreatedAt;
            dto.CreatedBy        = e.CreatedBy;
            dto.CommandId        = e.CommandId;
            var attributeValueEvents = new List <AttributeValueStateRemovedDto>();

            foreach (var ee in e.AttributeValueEvents)
            {
                AttributeValueStateRemovedDto eeDto = AttributeValueStateEventDtoConverter.ToAttributeValueStateRemovedDto(ee);
                attributeValueEvents.Add(eeDto);
            }
            dto.AttributeValueEvents = attributeValueEvents.ToArray();

            var attributeAliasEvents = new List <AttributeAliasStateRemovedDto>();

            foreach (var ee in e.AttributeAliasEvents)
            {
                AttributeAliasStateRemovedDto eeDto = AttributeAliasStateEventDtoConverter.ToAttributeAliasStateRemovedDto(ee);
                attributeAliasEvents.Add(eeDto);
            }
            dto.AttributeAliasEvents = attributeAliasEvents.ToArray();


            return(dto);
        }
Esempio n. 3
0
        public virtual AttributeStateMergePatchedDto ToAttributeStateMergePatchedDto(IAttributeStateMergePatched e)
        {
            var dto = new AttributeStateMergePatchedDto();

            dto.AttributeEventId     = e.AttributeEventId;
            dto.CreatedAt            = e.CreatedAt;
            dto.CreatedBy            = e.CreatedBy;
            dto.CommandId            = e.CommandId;
            dto.AttributeName        = e.AttributeName;
            dto.OrganizationId       = e.OrganizationId;
            dto.Description          = e.Description;
            dto.IsMandatory          = e.IsMandatory;
            dto.AttributeValueType   = e.AttributeValueType;
            dto.AttributeValueLength = e.AttributeValueLength;
            dto.IsList      = e.IsList;
            dto.FieldName   = e.FieldName;
            dto.ReferenceId = e.ReferenceId;
            dto.Active      = e.Active;
            dto.IsPropertyAttributeNameRemoved        = e.IsPropertyAttributeNameRemoved;
            dto.IsPropertyOrganizationIdRemoved       = e.IsPropertyOrganizationIdRemoved;
            dto.IsPropertyDescriptionRemoved          = e.IsPropertyDescriptionRemoved;
            dto.IsPropertyIsMandatoryRemoved          = e.IsPropertyIsMandatoryRemoved;
            dto.IsPropertyAttributeValueTypeRemoved   = e.IsPropertyAttributeValueTypeRemoved;
            dto.IsPropertyAttributeValueLengthRemoved = e.IsPropertyAttributeValueLengthRemoved;
            dto.IsPropertyIsListRemoved      = e.IsPropertyIsListRemoved;
            dto.IsPropertyFieldNameRemoved   = e.IsPropertyFieldNameRemoved;
            dto.IsPropertyReferenceIdRemoved = e.IsPropertyReferenceIdRemoved;
            dto.IsPropertyActiveRemoved      = e.IsPropertyActiveRemoved;
            var attributeValueEvents = new List <AttributeValueStateCreatedOrMergePatchedOrRemovedDto>();

            foreach (var ee in e.AttributeValueEvents)
            {
                AttributeValueStateCreatedOrMergePatchedOrRemovedDto eeDto = AttributeValueStateEventDtoConverter.ToAttributeValueStateEventDto(ee);
                attributeValueEvents.Add(eeDto);
            }
            dto.AttributeValueEvents = attributeValueEvents.ToArray();

            var attributeAliasEvents = new List <AttributeAliasStateCreatedOrMergePatchedOrRemovedDto>();

            foreach (var ee in e.AttributeAliasEvents)
            {
                AttributeAliasStateCreatedOrMergePatchedOrRemovedDto eeDto = AttributeAliasStateEventDtoConverter.ToAttributeAliasStateEventDto(ee);
                attributeAliasEvents.Add(eeDto);
            }
            dto.AttributeAliasEvents = attributeAliasEvents.ToArray();


            return(dto);
        }