public GetLastIndexResponse GetLastIndex(GetLastIndexRequest request)
        {
            try
            {
                string dataset = request.datasetId;
                if (dataset == "")
                {
                    throw new ArgumentException("Missing dataset in request");
                }
                int id = 0;
                int.TryParse(dataset, out id);

                string resp;
                string initType;
                var    datasets = from d in db.Datasets where d.DatasetId == id select d;
                initType = datasets.First().DatasetProvider;

                //Initiate provider from config/dataset
                Type providerType = Assembly.GetExecutingAssembly().GetType(initType);
                IChangelogProvider changelogprovider = Activator.CreateInstance(providerType) as IChangelogProvider;
                changelogprovider.Intitalize(id);
                resp = changelogprovider.GetLastIndex(id);

                GetLastIndexResponse res = new GetLastIndexResponse();
                res.@return = resp;
                return(res);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message);
            }
        }
        public UpdaterConfigurationViewModel(IUpdaterSettingsProvider settings,
                                             IApplicationVersion applicationVersion,
                                             IChangelogProvider changelogProvider,
                                             UpdateViewModel updateViewModel)
        {
            this.settings = settings;
            Watch(settings, s => s.Settings, nameof(LastCheckForUpdates));
            Watch(this, t => t.DisableAutoUpdates, nameof(IsModified));
            Watch(this, t => t.EnableSilentUpdates, nameof(IsModified));

            ShowChangelog = new DelegateCommand(changelogProvider.TryShowChangelog, changelogProvider.HasChangelog);
            Save          = new DelegateCommand(() =>
            {
                var sett = settings.Settings;
                sett.DisableAutoUpdates  = DisableAutoUpdates;
                sett.EnableSilentUpdates = EnableSilentUpdates;
                settings.Settings        = sett;
                RaisePropertyChanged(nameof(IsModified));
            });
            EnableSilentUpdates    = settings.Settings.EnableSilentUpdates;
            DisableAutoUpdates     = settings.Settings.DisableAutoUpdates;
            CheckForUpdatesCommand = updateViewModel.CheckForUpdatesCommand;
            CurrentVersion         = applicationVersion.VersionKnown
                ? $"build {applicationVersion.BuildVersion}"
                : "-- not known --";
        }
        public ChangelogIdentificationType OrderChangeLogAsync(IChangelogProvider changelogprovider,
                                                               int startindex, int count, string to_doFilter, int datasetID)
        {
            try
            {
                var resp = changelogprovider.OrderChangelog(startindex, count, "", datasetID);
                ChangelogIdentificationType res = new ChangelogIdentificationType();
                res.changelogId = resp.changelogId;
                return(res);
            }
            catch (Exception ex)
            {
                Logger.Error(ex, ex.Message);

                return(null);
            }
        }