public async Task PostFavorite(FavoriteSettings s, AccessToken personalInformation) { if (s.linked_type != null && s.linked_type.ToLower() == "person" && s.kind is null) { throw new Exception("Kind can not be null, when linked_id is Person"); } await NoResponseRequest($"favorites/{s.linked_type}/{s.linked_id}/{s.kind}", personalInformation); }
private void SaveSetting() { MessageDisplay msgDisplay = CreateMessageDisplay("EnableFavoriteFunction"); FavoriteSettings favoriteSettings = new FavoriteSettings(); favoriteSettings.EnableFavoriteFunction = _Request.Get <bool>("EnableFavoriteFunction", Method.Post, true); if (!msgDisplay.HasAnyError()) { SettingManager.SaveSettings(favoriteSettings); } }
public async Task DeleteFavorite(FavoriteSettings s, AccessToken personalInformation) { await NoResponseRequest($"favorites/{s.linked_type}/{s.linked_id}", personalInformation, method : "DELETE"); }