コード例 #1
0
        public async Task <ActionResult <MetricResource> > CreateMetricAsync(AddMetricCommand metricCommand)
        {
            var metricResource = await _mediator.Send(metricCommand);

            return(CreatedAtAction(
                       nameof(GetMetricAsync),
                       new { metricId = metricResource.Id, version = RequestedApiVersion },
                       metricResource));
        }
コード例 #2
0
        public async Task <ActionResult> AddMetric(AddMetricCommand command)
        {
            var metricId = await _mediator.SendAsync(command);

            return(Created("", metricId));
        }