Exemplo n.º 1
0
        public static async Task <StoryUser> GetUserAsync(this SCLM sclm, string userId)
        {
            StoryUser user = await sclm.GETAsync <StoryUser>(new Uri($"{sclm.GetEndpoint(api)}/{Version}/{Path}/{userId}", UriKind.Absolute), CancellationToken.None);

            user.Context = sclm;
            return(user);
        }
Exemplo n.º 2
0
        public static async Task <StoryUser> GetUserAsync(this SCLM sclm, StoryUserItem user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            StoryUser u = await sclm.GETAsync <StoryUser>(new Uri($"{sclm.GetEndpoint(api)}/{Version}/{Path}/{user.Id}", UriKind.Absolute), CancellationToken.None);

            u.Context = sclm;
            return(u);
        }
Exemplo n.º 3
0
        public static async Task <StoryUser> UserExistsAsync(this SCLM sclm, string username)
        {
            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentNullException(nameof(username));
            }
            StoryUser user = await sclm.GETAsync <StoryUser>(new Uri($"{sclm.GetEndpoint(api)}{Version}/{Path}/exists?username={username}", UriKind.Absolute), CancellationToken.None);

            user.Context = sclm;
            return(user);
        }