Esempio n. 1
0
        /// <summary>
        /// Returns a list of networks to which the current user has access.
        /// </summary>
        /// <param name="includeSuspended">The option to include the network the user is suspended in.</param>
        /// <param name="excludeOwnMessagesFromUnseen">The option to exclude the user's own messages from the unseen count.</param>
        /// <returns>The <see cref="Network"/>.</returns>
        public async Task<IQueryable<Network>> Current(
            bool includeSuspended = true,
            bool excludeOwnMessagesFromUnseen = true)
        {
            var query = new NetworkQuery(includeSuspended, excludeOwnMessagesFromUnseen);
            var url = this.GetFinalUrl(string.Format("{0}/current.json", Endpoints.Networks), query.SerializeQueryString());
            var result = await this.Client.GetAsync<Network[]>(url);

            return result.Content.AsQueryable();
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a list of networks to which the current user has access.
        /// </summary>
        /// <param name="includeSuspended">The option to include the network the user is suspended in.</param>
        /// <param name="excludeOwnMessagesFromUnseen">The option to exclude the user's own messages from the unseen count.</param>
        /// <returns>The <see cref="Network"/>.</returns>
        public async Task <IQueryable <Network> > Current(
            bool includeSuspended             = true,
            bool excludeOwnMessagesFromUnseen = true)
        {
            var query  = new NetworkQuery(includeSuspended, excludeOwnMessagesFromUnseen);
            var url    = this.GetFinalUrl(string.Format("{0}/current.json", Endpoints.Networks), query.SerializeQueryString());
            var result = await this.Client.GetAsync <Network[]>(url);

            return(result.Content.AsQueryable());
        }