private WordStatV1 ConvertToDataRecord(WordStatistics item)
 {
     return(new WordStatV1
     {
         DateLearned = item.DateLearned,
         LastTimeAnswered = item.LastTimeAnswered,
         NumberOfTimesAnsweredCorrectly = item.NumberOfTimesAnsweredCorrectly,
         NumberOfTimesAsked = item.NumberOfTimesAsked,
         UniqueId = item.UniqueId,
     });
 }
Пример #2
0
        private void AddNewWord(string word, string translation)
        {
            var w = new Word();

            w.CreationDate = DateTime.UtcNow;
            w.Value        = word;
            var t = new Translation();

            t.Value = translation;
            var s = new WordStatistics();

            _session.SaveOrUpdate(s);
            w.Statistics = s;

            w.Translations.Add(t);
            _session.SaveOrUpdate(w);
            _session.Flush();
            _session.Refresh(t);
        }
Пример #3
0
 private void SaveStatistics(WordStatistics statistics)
 {
     WordsService.Update <WordStatistics>(statistics);
 }
 public void AddStatisticsItem(WordStatistics item)
 {
     _fileData.WordStats.Add(ConvertToDataRecord(item));
 }