using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using StubCore.Entities;
using StubAP.Plugins.ReferenceData;

namespace StubAP.Plugins.Binders
{
    public class ProfileBinder
    {
        public ProfileItem CreateProfileItem(Profile _profile, int files, int nodes, int values)
        {
            var _reference = new ReferenceOperations();

            return new ProfileItem
            {
                id = _profile.id,
                name = _profile.name,
                nameID = _profile.nameID,
                link = HttpContext.Current.Request.Url.Authority + "/api/" + _profile.requestType + "/" + _profile.nameID,
                description = _profile.description,
                outputTransport = _reference.DefineValueByID("OutputTransport", _profile.outputTransportType),
                containsFiles = files,
                containsNodes = nodes,
                containsValues = values
            };
        }

    }
}