Beispiel #1
0
        public async Task DeleteByIdAsync(HttpRequest request, HttpResponse response, ClaimsPrincipal user,
                                          RouteData routeData)
        {
            var correlationId = GetCorrelationId(request);
            var parameters    = GetParameters(request);
            var id            = parameters.GetAsNullableString("dummy_id") ?? parameters.GetAsNullableString("id");

            var result = await _controller.DeleteByIdAsync(correlationId, id);

            await SendResultAsync(response, result);
        }
        private ICommand MakeDeleteByIdCommand()
        {
            return(new Command(
                       "delete_dummy",
                       new ObjectSchema()
                       .WithRequiredProperty("dummy_id", Commons.Convert.TypeCode.String),
                       async(correlationId, args) =>
            {
                var dummyId = args.GetAsString("dummy_id");

                return await _controller.DeleteByIdAsync(correlationId, dummyId);
            }));
        }
Beispiel #3
0
        public async Task <ProtoDummy> DeleteDummyByIdAsync(DummyIdRequest request, ServerCallContext context)
        {
            var item = await _controller.DeleteByIdAsync(request.CorrelationId, request.DummyId);

            return(ConvertToPublic(item));
        }