Unite.Messaging.Services.ServiceProvider.GetService C# (CSharp) Method

GetService() public method

public GetService ( ServiceInformation info ) : IMessagingService
info Unite.Messaging.Entities.ServiceInformation
return IMessagingService
        public IMessagingService GetService(ServiceInformation info)
        {
            if(Services == null)
                throw new NullReferenceException("This service provider has a null collection of services. You should NEVER have this issue.");

            foreach (var service in Services)
            {
                if(service.GetInformation().Equals(info)) return service;
            }

            throw new InvalidOperationException("The requested service does not exist. You should NEVER see this.");
        }