private void SaveQueryResultToDb(Stream stream)
        {
            stream.Position = 0;
            StreamReader reader   = new StreamReader(stream);
            string       response = reader.ReadToEnd();

            var settingQueryResult = _settingQueryResultService.Get();

            if (settingQueryResult == null)
            {
                settingQueryResult = new SettingQueryResult
                {
                    Id = 1,
                    LastSearchResult = response,
                    LastSearchFilter = ""
                };
                _settingQueryResultService.Add(settingQueryResult);
            }
            else
            {
                settingQueryResult.LastSearchResult = response;
                _settingQueryResultService.Update(settingQueryResult);
            }
        }
Beispiel #2
0
 public void Update(SettingQueryResult entry)
 {
     _databaseContext.SettingQueryResults.Update(entry);
     _databaseContext.SaveChanges();
 }
Beispiel #3
0
 public void Add(SettingQueryResult entry)
 {
     _databaseContext.SettingQueryResults.Add(entry);
     _databaseContext.SaveChanges();
 }