using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace InABox.Core
{
    
    public class CoreFieldMapPair<T1, T2>
    {
            
        public Expression<Func<T1, object>> From { get; private set; }
        public Expression<Func<T2, object>> To { get; private set; }
            
        public CoreFieldMapPair(Expression<Func<T1, object>> from, Expression<Func<T2, object>> to)
        {
            From = from;
            To = to;
        }
    }

    
    public class CoreFieldMap<T1, T2>
    {
        private List<CoreFieldMapPair<T1, T2>> _fields = new List<CoreFieldMapPair<T1, T2>>();

        public CoreFieldMapPair<T1, T2>[] Fields => _fields.ToArray();
        
        public CoreFieldMap<T1, T2> Add(Expression<Func<T1, object>> from, Expression<Func<T2, object>> to)
        {
            _fields.Add(new CoreFieldMapPair<T1, T2>(from, to));
            return this;
        }
    }
}