﻿using System;
using System.Linq.Expressions;

namespace SmartMapper.Converters
{
    public class InlineConverter<TSource, TDestination> : GlobalTypeConverter<TSource, TDestination>
    {
        private Expression<Func<TSource, TDestination>> conversion;

        public InlineConverter(Expression<Func<TSource, TDestination>> conversion)
        {
            this.conversion = conversion;
        }

        public override Expression<Func<TSource, TDestination>> GetConversion(ConversionContext context)
        {
            return conversion;
        }
    }
}
