public override Sitecore.Analytics.DataAccess.LockAttemptResult<IContact> TryLoadContact(
            string identifier,
            IContactFactory factory,
            LeaseOwner leaseOwner,
            TimeSpan leaseDuration)
        {
            var res = this.contactService.TryLoadAndLock(
                identifier,
                this.modelMapper.Map<LeaseOwner, ElasticLeaseOwner>(leaseOwner),
                leaseDuration,
                this.ctx);

            IContact scContact = null;
            if (res.LockedObject != null)
            {
                scContact = factory.Create(new ID(res.LockedObject.Id));
                this.modelMapper.Map(res.LockedObject, scContact);
            }

            return new Sitecore.Analytics.DataAccess.LockAttemptResult<IContact>(
                (LockAttemptStatus)(int)res.Status,
                scContact,
                this.modelMapper.Map<ElasticLeaseOwner, LeaseOwner>(res.LeaseOwner));
        }
 public override IContact LoadContactReadOnly(ID id, IContactFactory factory)
 {
     var res = this.contactService.LoadForReadOnly(id.Guid, this.ctx);
     var scContact = factory.Create(new ID(res.Id));
     return this.modelMapper.Map(res, scContact);
 }