using System;

using BeWo.Data.Entities;

using BS.Shared.DataContracts.Compact;

namespace BeWo.Service.DCEntityMapper
{
    public class CompactTeamDC_Team : AbstractIDCEntityMapper<Team, CompactTeamDC>
    {
        public override CompactTeamDC MergeWithDC(Team pEntity, CompactTeamDC pDataContract)
        {
            pDataContract.Name = pEntity.Name;
            pDataContract.LeaderString = pEntity.Leader.Person.LastName + ", " + pEntity.Leader.Person.FirstName;
            pDataContract.TeamOid = pEntity.Oid.Value;
            pDataContract.TeamVersion = pEntity.Version.Value;

            return pDataContract;
        }

        public override Team MergeWithEntity(CompactTeamDC pDataContract, Team pEntity)
        {
            throw new NotImplementedException();
        }

        protected override bool AreDCAndEntityEqual(CompactTeamDC pDC, Team pEntity)
        {
            return pDC.TeamOid == pEntity.Oid;
        }
    }
}