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

namespace Falcor.Net.Router.Models
{
    internal sealed class EntityMapping
    {
        public EntityMapping(string alias, Type entityType, string keyPropertyName, Func<object, object> accessKeyProperty, Func<IEnumerable<string>, IEnumerable<object>> resolveEntities)
        {
            Alias = alias;
            KeyPropertyName = keyPropertyName;
            EntityResolveFuntion = resolveEntities;
            EntityType = entityType;
            AccessKeyProperty = accessKeyProperty;
        }

        public string Alias { get; private set; }

        public Type EntityType { get; private set; }
    
        public string KeyPropertyName { get; private set; }

        public Func<object, object> AccessKeyProperty { get; private set; }

        public Func<IEnumerable<string>, IEnumerable<object>> EntityResolveFuntion { get; private set; }
    }
}
