/// <summary>
 /// Trigger an event for subscriptions
 /// </summary>
 /// <param name="ctx"></param>
 /// <param name="message"></param>
 public static async Task TriggerEvent <T>(this IResolverContext ctx, T message) where T : IEventMessage
 {
     await ctx.Service <IEventSender>().SendAsync(message);
 }
 /// <summary>
 /// Save context (db transactions)
 /// </summary>
 /// <param name="ctx"></param>
 public static async Task Save(this IResolverContext ctx)
 {
     await ctx.Service <IPersistenceService>().CompleteAsync();
 }
Exemple #3
0
 public static ITypeConversion GetTypeConversion(
     this IResolverContext services)
 {
     return(services.Service <IServiceProvider>().GetTypeConversion());
 }
        public static ValueTask SendEventMessage <T>(this IResolverContext context, EventMessage <T> message)
        {
            var eventSender = context.Service <ITopicEventSender>();

            return(eventSender.SendAsync((message.GetType(), message.Topic), message.Payload));
        }
 public T Service <T>() => _resolverContext.Service <T>();