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); }
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); }
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); }