public async Task Update(int[] epId, EpStatus status) { if (epId == null) { throw new ArgumentNullException(nameof(epId)); } if (epId.Length <= 0) { throw new ArgumentOutOfRangeException(nameof(status)); } if (!Enum.IsDefined(typeof(EpStatus), status)) { throw new ArgumentOutOfRangeException(nameof(status)); } var url = $"/ep/{epId.Last()}/status/{status.ToString().ToLowerInvariant()}"; using (var client = new BangumiClient(_oauthProvider)) { using (var postContent = new FormUrlEncodedContent(Enumerable.Empty <KeyValuePair <string, string> >())) { await client.PostAsync(url, postContent); } } }
public static string GetValue(this EpStatus status) { switch (status) { case EpStatus.Watched: return("watched"); case EpStatus.Queue: return("queue"); case EpStatus.Drop: return("drop"); case EpStatus.Remove: return("remove"); default: return(status.ToString()); } }