Esempio n. 1
0
        internal override ICompletes <Response> Execute(
            Request request,
            Action.MappedParameters mappedParameters,
            ILogger logger)
        {
            var param1 = ResolverParam1.Apply(request, mappedParameters);
            var param2 = ResolverParam2.Apply(request, mappedParameters);

            return(Execute(request, param1, param2, logger));
        }
        public void HandleFor(Context context, Action.MappedParameters mappedParameters, RequestHandler handler)
        {
            Action <ResourceHandler> consumer = resource =>
                                                handler
                                                .Execute(context.Request !, mappedParameters, resource.Logger !)
                                                .AndThen(outcome => RespondWith(context, outcome))
                                                .Otherwise <Response>(failure => RespondWith(context, failure))
                                                .RecoverFrom(exception => Response.Of(Response.ResponseStatus.BadRequest, exception.Message));

            HandleFor(context, consumer);
        }
Esempio n. 3
0
 public void HandleFor(Context context, Action.MappedParameters mappedParameters, RequestHandler handler)
 {
     if (!_actor.IsStopped)
     {
         Action <IResourceRequestHandler> cons128873 = __ => __.HandleFor(context, mappedParameters, handler);
         if (_mailbox.IsPreallocated)
         {
             _mailbox.Send(_actor, cons128873, null, HandleForRepresentation2);
         }
         else
         {
             _mailbox.Send(
                 new LocalMessage <IResourceRequestHandler>(_actor, cons128873,
                                                            HandleForRepresentation2));
         }
     }
     else
     {
         _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, HandleForRepresentation2));
     }
 }
Esempio n. 4
0
 internal abstract ICompletes <Response> Execute(
     Request request,
     Action.MappedParameters mappedParameters,
     ILogger logger);
Esempio n. 5
0
 public T Apply(Request?request, Action.MappedParameters mappedParameters)
 => _resolver.Invoke(request !, mappedParameters);
Esempio n. 6
0
 object IParameterResolver.Apply(Request request, Action.MappedParameters mappedParameters)
 => _resolver.Invoke(request, mappedParameters) !;
 internal override ICompletes <Response> Execute(Request request, Action.MappedParameters mappedParameters, ILogger logger)
 => Execute(request, Resolver.Apply(request, mappedParameters), logger);
Esempio n. 8
0
 public abstract void DispatchToHandlerWith(Context context, Action.MappedParameters mappedParameters);
Esempio n. 9
0
 public override void DispatchToHandlerWith(Context context, Action.MappedParameters mappedParameters)
 {
     throw new NotImplementedException();
 }