Example #1
0
        public void Initialise()
        {
            const int specialOffset = 535;

            var nameId = _calculator.GetTrackDriverNameId(Id);

            if (nameId >= 200 && nameId <= 203)
            {
                // Use special offset for retired fastest lap drivers (language file index 6530 to 6533)
                Description = DescriptionOffset + nameId + specialOffset;
            }
            else
            {
                Description = DescriptionOffset + nameId;
            }
        }
        public TrackDriverLookupDataEntity Import(int id)
        {
            if (id < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(id));
            }

            var dataLocator = _dataLocatorFactory.Create(id);

            dataLocator.Initialise();

            var result = _dataEntityFactory.Create(id);

            result.Value       = _identityCalculator.GetTrackDriverNameId(result.Id);
            result.Description = _dataEndpoint.EnglishLanguageCatalogue.Read(dataLocator.Description).Value;

            return(result);
        }