/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p">Параметры.</param> /// <returns></returns> public static VkParameters ToVkParameters(AudioSearchParams p) { return(new VkParameters { { "q", p.Query }, { "auto_complete", p.Autocomplete }, { "sort", p.Sort }, { "lyrics", p.Lyrics }, { "performer_only", p.PerformerOnly }, { "search_own", p.SearchOwn }, { "count", p.Count }, { "offset", p.Offset } }); }
/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p">Параметры.</param> /// <returns></returns> internal static VkParameters ToVkParameters(AudioSearchParams p) { return new VkParameters { { "q", p.Query }, { "auto_complete", p.Autocomplete }, { "sort", p.Sort }, { "lyrics", p.Lyrics }, { "performer_only", p.PerformerOnly }, { "search_own", p.SearchOwn }, { "count", p.Count }, { "offset", p.Offset } }; }
public ReadOnlyCollection<Audio> Search(AudioSearchParams @params, out long totalCount) { if (string.IsNullOrEmpty(@params.Query)) { throw new ArgumentNullException("Query is null or empty.", "query"); } var response = Search(@params); totalCount = Convert.ToInt64(response.TotalCount); return response.ToReadOnlyCollection(); }
public ReadOnlyCollection<Audio> Search( string query, out long totalCount, bool? autoComplete = null, AudioSort? sort = null, bool? findLyrics = null, uint? count = null, uint? offset = null) { var parameters = new AudioSearchParams { Query = query, Autocomplete = autoComplete, Sort = sort, Lyrics = findLyrics, Count = Convert.ToInt32(count), Offset = offset }; return Search(parameters, out totalCount); }