Exemplo n.º 1
0
        public override void Convert(Connection connection, T entity, U dto, PropertyInfo sourcePropertyInfo)
        {
            ReferenceAttribute referenceAttribute  = sourcePropertyInfo.GetCustomAttribute <ReferenceAttribute>();
            ReferenceString    referenceString     = sourcePropertyInfo.GetValue(dto) as ReferenceString;
            Type referencedEntityType              = GetReferencedEntityType(entity, referenceAttribute);
            IReferenceConverter referenceConverter = GetReferenceConverter(referenceAttribute, typeof(T), referencedEntityType);

            referenceConverter.Convert(connection, entity, dto, sourcePropertyInfo, referenceAttribute, referenceString);
        }
Exemplo n.º 2
0
        public override void Convert(IUnitOfWork unitOfWork, T dto, U entity, PropertyInfo sourcePropertyInfo)
        {
            ReferenceAttribute referenceAttribute  = sourcePropertyInfo.GetCustomAttribute <ReferenceAttribute>();
            ReferenceString    referenceString     = sourcePropertyInfo.GetValue(dto) as ReferenceString;
            Type referencedEntityType              = GetReferencedEntityType(entity, referenceAttribute);
            IReferenceConverter referenceConverter = GetReferenceConverter(referenceAttribute, typeof(U), referencedEntityType);

            referenceConverter.Convert(unitOfWork, entity, dto, sourcePropertyInfo, referenceAttribute, referenceString);
        }