public static void AddTimerRoute(this IRouteBuilder routeBuilder) { routeBuilder.MapPut("actors/{actorTypeName}/{actorId}/method/timer/{timerName}", async context => { var routeValues = context.Request.RouteValues; var actorTypeName = (string)routeValues["actorTypeName"]; var actorId = (string)routeValues["actorId"]; var timerName = (string)routeValues["timerName"]; // read dueTime, period and data from Request Body. await ActorRuntime.FireTimerAsync(actorTypeName, actorId, timerName); }); }
public static IEndpointConventionBuilder AddTimerRoute(this IEndpointRouteBuilder endpoints) { return(endpoints.MapPut("actors/{actorTypeName}/{actorId}/method/timer/{timerName}", async context => { var routeValues = context.Request.RouteValues; var actorTypeName = (string)routeValues["actorTypeName"]; var actorId = (string)routeValues["actorId"]; var timerName = (string)routeValues["timerName"]; // read dueTime, period and data from Request Body. await ActorRuntime.FireTimerAsync(actorTypeName, actorId, timerName); })); }