Пример #1
0
        public override int GetHashCode()
        {
            int hashCode = -1676672959;

            if (Context != null)
            {
                hashCode += Context.GetHashCode();
            }

            if (Errors != null)
            {
                hashCode += Errors.GetHashCode();
            }

            if (SubscriptionEvents != null)
            {
                hashCode += SubscriptionEvents.GetHashCode();
            }

            if (Cursor != null)
            {
                hashCode += Cursor.GetHashCode();
            }

            return(hashCode);
        }
Пример #2
0
 public Task ReceiveAsync(IContext context)
 {
     return(context.Message switch
     {
         Started => OnStarted(context),
         Stopping => OnStopping(),
         SubscriptionEvents request => OnSubscriptionEvents(request, context),
         _ => Task.CompletedTask
     });
Пример #3
0
 /// <summary>
 /// Register subscription events
 /// </summary>
 /// <param name="services"></param>
 /// <returns></returns>
 public static IServiceCollection RegisterSubscriptionEvents(this IServiceCollection services)
 {
     SubscriptionEvents.RegisterEvents();
     return(services);
 }
Пример #4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ListSubscriptionEventsResponse other &&
                   ((Context == null && other.Context == null) || (Context?.Equals(other.Context) == true)) &&
                   ((Errors == null && other.Errors == null) || (Errors?.Equals(other.Errors) == true)) &&
                   ((SubscriptionEvents == null && other.SubscriptionEvents == null) || (SubscriptionEvents?.Equals(other.SubscriptionEvents) == true)) &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)));
        }
Пример #5
0
 public SubscriptionCreate(SubscriptionEvents eventName, string url)
 {
     Event = eventName.GetName();
     Url   = url;
 }