예제 #1
0
        private void ValidateSubscribeRequest(SubscribeRequest subscribeRequest)
        {
            if (string.IsNullOrWhiteSpace(subscribeRequest.Channel))
            {
                throw new ArgumentException("Parameter is mandatory", "Channel");
            }

            if (!subscribeRequest.IsValideType("CommandQuery"))// SubscribeType
            {
                throw new ArgumentException("Invalid Subscribe Type for this Class.", "SubscribeType");
            }
        }
예제 #2
0
 private void ValidateSubscribeRequest(SubscribeRequest subscribeRequest)
 {
     if (string.IsNullOrWhiteSpace(subscribeRequest.Channel))
     {
         throw new ArgumentException("Parameter is mandatory", "Channel");
     }
     if (!subscribeRequest.IsValideType("Events"))// SubscribeType
     {
         throw new ArgumentException("Invalid Subscribe Type for this Class.", "SubscribeType");
     }
     if (subscribeRequest.SubscribeType == SubscribeType.EventsStore)
     {
         if (string.IsNullOrWhiteSpace(subscribeRequest.ClientID))
         {
             throw new ArgumentException("Parameter is mandatory for this type.", "ClientID");
         }
         if (subscribeRequest.EventsStoreType == EventsStoreType.Undefined)
         {
             throw new ArgumentException("Parameter is mandatory for this type.", "EventsStoreType");
         }
     }
 }