public static ChangedWithinEnum MapChangesetIntervalToChangedWithin(Req.ChangeSetInterval changeSetInterval) { switch (changeSetInterval) { case Req.ChangeSetInterval.Undefined: return ChangedWithinEnum.Undefined; break; case Req.ChangeSetInterval.EinerWoche: return ChangedWithinEnum.EinerWoche; break; case Req.ChangeSetInterval.ZweiWochen: return ChangedWithinEnum.ZweiWochen; break; case Req.ChangeSetInterval.EinemMonat: return ChangedWithinEnum.EinemMonat; break; case Req.ChangeSetInterval.DreiMonaten: return ChangedWithinEnum.DreiMonaten; break; case Req.ChangeSetInterval.SechsMonaten: return ChangedWithinEnum.SechsMonaten; break; case Req.ChangeSetInterval.EinemJahr: return ChangedWithinEnum.EinemJahr; break; } throw new ArgumentOutOfRangeException(); }
private async Task<SearchResult> QueryAsync(Req.T_OGDSearchRequest request, int seitenNummer) { request.Seitennummer = seitenNummer; request.Sortierung = new Req.BundesnormenSortExpression() { SortDirection = Req.WebSortDirection.Ascending, SortedByColumn = Req.BundesnormenSortableColumn.Kurzinformation }; // We do continuous loading in the UI, thus the user cannot specify the page size request.DokumenteProSeiteSpecified = true; request.DokumenteProSeite = Req.PageSize.Fifty; try { string requestAsString = MessageSerializationHelper.SerializeToString(request); var client = CreateServiceClient(); requestResponse response = await client.requestAsync("Br", requestAsString); var searchResult = MessageSerializationHelper.DeserializeFromString<Resp.T_OGDSearchResult>(response.Body.requestResult); return Mapper.MapSearchResult(searchResult); } catch (Exception ex) { return new SearchResult(ex.ToString()); } }