public bool IsSubscribed(string streamname) { if (streamname == null || streamname == "") { throw new ArgumentException("StreamName must be not be null or empty"); } if (StreamSubscriptions != null && StreamSubscriptions.Where(ss => ss.Stream != null && ss.Stream.StreamName.ToLower() == streamname.ToLower() && ss.Subscribed == SubscriptionState.Subscribed).FirstOrDefault() != null) { return(true); } return(false); }
public String[] GetActiveSubscribers() { //If you read this you probably forgot to "Include" either StreamSubscriptions or User in your EF Query return(StreamSubscriptions.Where(x => x.Subscribed == SubscriptionState.Subscribed).Select(x => x.User.ChatUserName).ToArray()); }