コード例 #1
0
        public async Task <ActionResult <EntitiesResponse <Document> > > UpdateState([FromBody] List <int> ids, [FromQuery] UpdateStateArguments args)
        {
            var serverTime = DateTimeOffset.UtcNow;
            var result     = await _service.UpdateState(ids, args);

            var response = TransformToEntitiesResponse(result, serverTime, cancellation: default);

            Response.Headers.Set("x-definitions-version", Constants.Stale);
            if (args.ReturnEntities ?? false)
            {
                return(Ok(response));
            }
            else
            {
                return(Ok());
            }
        }
コード例 #2
0
        public async Task <ActionResult <EntitiesResponse <Document> > > Close([FromBody] List <int> ids, [FromQuery] UpdateStateArguments args)
        {
            return(await ControllerUtilities.InvokeActionImpl(async() =>
            {
                var serverTime = DateTimeOffset.UtcNow;
                var(data, extras) = await _service.UpdateState(ids, args);
                var response = TransformToEntitiesResponse(data, extras, serverTime, cancellation: default);

                Response.Headers.Set("x-definitions-version", Constants.Stale);
                if (args.ReturnEntities ?? false)
                {
                    return Ok(response);
                }
                else
                {
                    return Ok();
                }
            },
                                                              _logger));
        }