private void fillTranslateResultIdsForNewItem(int sourceDefinitionID, int definitionTypeID, ResultLineData curVariant)
 {
     var savedTranslatedExpressionItems = from item in SqlLiteInstance.DB.Table<TranslatedExpression>()
                                       where (item.SourceDefinitionID == sourceDefinitionID) && (item.DeleteMark == 0) && (item.TranslatedText == curVariant.Text)
                                       select new TranslatedExpression {ID = item.ID};
     curVariant.TranslatedExpressionId = savedTranslatedExpressionItems.ToList()[0].ID;
 }
 private TranslateResultView createTranslateResult(string sourceString, List<SourceExpression> sourceList, List<SourceDefinition> definitionsList, List<Tuple<TranslatedExpression, Favorites>> translatedList)
 {
     TranslateResultView result = new TranslateResultView();
     foreach (var definition in definitionsList)
     {
         List<ResultLineData> translateVariants = new List<ResultLineData>();
         var viewVariants = from item in translatedList where item.Item1.SourceDefinitionID == definition.ID select new { item.Item1, item.Item2 };
         foreach (var item in viewVariants)
         {
             var dataLine = new ResultLineData(item.Item1.TranslatedText, (DefinitionTypesEnum)(item.Item1.DefinitionTypeID));
             dataLine.TranslatedExpressionId = item.Item1.ID;
             if(item.Item2!=null)
             {
                 dataLine.FavoritesId = item.Item2.ID;
             }
             translateVariants.Add(dataLine);
         }
         result.AddDefinition(sourceString, (DefinitionTypesEnum)definition.DefinitionTypeID, definition.TranscriptionText, translateVariants);
     }
     return result;
 }