Exemple #1
0
        public List <WebAPIDto <DossierModel> > GetFromPostMethod()
        {
            WebApiHttpClient httpClient = GetWebAPIClient(CurrentTenant);

            DossierFinderModel.Skip = PageIndex;
            DossierFinderModel.Top  = (CustomPageIndex + 1) * PageSize;
            Dictionary <string, DossierFinderModel> finders = new Dictionary <string, DossierFinderModel>();

            finders.Add("finder", DossierFinderModel);
            string bodyQuery = JsonConvert.SerializeObject(finders, new StringEnumConverter());
            IEnumerable <DossierModel> results = httpClient.PostStringAsync <Dossier>($"/{CommonDefinition.OData.DossierService.FX_GetAuthorizedDossiers}", bodyQuery).ResponseToModel <ODataModel <ICollection <DossierModel> > >().Value;

            return(results.Select(dossierModel => new WebAPIDto <DossierModel>
            {
                Entity = dossierModel,
                TenantModel = CurrentTenant
            }).ToList());
        }
Exemple #2
0
        public override int Count()
        {
            if (!FromFinderModel)
            {
                return(base.Count());
            }

            return(CurrentTenantExecutionWebAPI <Fascicle, int>((tenant) =>
            {
                WebApiHttpClient httpClient = GetWebAPIClient(CurrentTenant);
                Dictionary <string, FascicleFinderModel> finders = new Dictionary <string, FascicleFinderModel>();
                finders.Add("finder", FascicleFinderModel);
                string bodyQuery = JsonConvert.SerializeObject(finders, new StringEnumConverter());
                int result = httpClient.PostStringAsync <Fascicle>($"/{CommonDefinition.OData.FascicleService.FX_GetCountAuthorizedFascicles}", bodyQuery).ResponseToModel <ODataModel <int> >().Value;

                return result;
            }, nameof(Count)));
        }