Exemple #1
0
 /// <inheritdoc />
 public async Task <bool> TryCreateAsync(TModelType model)
 {
     //TODO: Should we validate no key already exists?
     ModelSet.Add(model);
     return(await SaveAndCheckResultsAsync()
            .ConfigureAwaitFalse());
 }
Exemple #2
0
        public void ConstructStatsForPilot(AcesHighPilotStats stats, string pilotName)
        {
            if (stats.VsObjects.ObjectScore == null)
            {
                throw new ApplicationException(string.Format("No stats objects can be found for pilot {0} in tour {1}",
                                                             pilotName, stats.TourDetails));
            }

            // for each aircraft listed for that tour.
            foreach (var objScore in stats.VsObjects.ObjectScore)
            {
                // build mathmatical set of models (eg no duplicate entries).
                ModelSet.Add(objScore.Model);

                // add objVsObj score to our complete list.
                var objVsObjDo = new ObjectVsObjectDO(objScore, stats.TourDetails, stats.TourType,
                                                      int.Parse(stats.TourId));
                GetPilotStats(pilotName).ObjVsObjCompleteList.Add(objVsObjDo);
            }
        }
 /// <inheritdoc />
 public async Task <bool> TryCreateAsync(TModelType model, CancellationToken token = default)
 {
     //TODO: Should we validate no key already exists?
     ModelSet.Add(model);
     return(await SaveAndCheckResultsAsync(token));
 }