Ejemplo n.º 1
0
        public void ApplyConfiguration(IMemberConfigurationExpression memberConfigurationExpression)
        {
            var sourceMemberAttribute = memberConfigurationExpression.DestinationMember.GetCustomAttribute <SourceMemberAttribute>();

            if (sourceMemberAttribute != null)
            {
                memberConfigurationExpression.ConvertUsing(Type, sourceMemberAttribute.Name);
            }
            else
            {
                memberConfigurationExpression.ConvertUsing(Type);
            }
        }
 public static void ConvertToHtmlContent <TSource, TDestination>(
     this IMemberConfigurationExpression <TSource, TDestination, IHtmlContent> expression,
     Expression <Func <TSource, string> > sourceMember
     )
 {
     ThrowIfExpressionIsNull(expression);
     expression.ConvertUsing <HtmlContentConverter, string>(sourceMember);
 }
Ejemplo n.º 3
0
        public static void ConvertMediaPathToUri <TSource, TDestination>(this IMemberConfigurationExpression <TSource, TDestination, Uri> expression, Expression <Func <TSource, string> > sourceMember)
        {
            if (expression == null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            expression.ConvertUsing <MediaUriConverter, string>(sourceMember);
        }