Ejemplo n.º 1
0
        public async Task <ActionResult <ProcessDefinitionModel> > Get(int id)
        {
            var item = await this.deploymentManager.CreateDefinitionQuery()
                       .SetId(id)
                       .SingleAsync();

            if (item != null)
            {
                return(ProcessDefinitionModel.Create(item));
            }

            return(this.NotFound());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <PagedResult <ProcessDefinitionModel> > > Get(
            [FromBody] ProcessDefinitionFilter filter)
        {
            PagedResult <ProcessDefinitionModel> result = new PagedResult <ProcessDefinitionModel>();

            var query = this.deploymentManager.CreateDefinitionQuery()
                        .FetchLatestVersionOnly();

            result.Count = await query.CountAsync();

            var items = await query.ListAsync(filter.Page, filter.PageSize);

            result.Items    = items.Select(x => ProcessDefinitionModel.Create(x)).ToList();
            result.Page     = filter.Page;
            result.PageSize = filter.PageSize;

            return(result);
        }