private void Button_Click(object sender, RoutedEventArgs e) { if (isNew) { var retVal = RESTApiClient.PostAsync <Member>(Member); } else { var retVal = RESTApiClient.PutAsync <Member>(Member); } }
public async void LoadData() { progress1.Visibility = Visibility.Visible; Items = await RESTApiClient.GetAsync <Member>(); //lstMembers.ItemsSource = Items; //var ttt = from t in Items // group t by t.LastName.Substring(0, 1) into g // orderby g.Key // select g; membersCVS.Source = Items.GroupBy(x => x.LastName.Substring(0, 1).ToUpper()); //membersCVS.Source = Items.GroupBy(x => x.Name.Substring(0, 1).ToUpper(), (alphabet, subList) => new { Alphabet = alphabet, SubList = subList.OrderBy(x => x.Name).ToList() }) .OrderBy(x => x.Alphabet); progress1.Visibility = Visibility.Collapsed; }
static void Main(string[] args) { string url = "http://services.theknot.com/registry/v1/affiliates/994/convertmanualregistryurl?st=WeddingWebsite&apikey=c49043b243ea978bc8667f67b1d7179a"; RESTApiClient client = new RESTApiClient(); ManualRegistryUrlConversionRequest req = new ManualRegistryUrlConversionRequest() { ManualRegistryURLs = new List<ManualRegistryURL>() { new ManualRegistryURL(){ Position=0, Url="http://www.target.com/RegistryGiftGiverCmd?isPreview=false&status=completePageLink®istryType=BB&isAjax=false&listId=qr5aAYL6-UxlDyY8DhBlTA&clkid=wT20fuXaEX-dyTA0opSPP2wlUkQ0k6VR2QUVWU0&lnm=Online Tracking Link&afid=Thehttp://uw.thebump.com/admin/edit/34393925 Knot%2C Inc. and Subsidiaries&ref=tgt_adv_"}, new ManualRegistryURL(){ Position=1, Url="http://www.potterybarn.com/registry/2966556/registry-list.html"} , new ManualRegistryURL(){ Position=2, Url="http://www.target.com/RegistryGiftGiverCmd?isPreview=false&status=completePageLink®istryType=BB&isAjax=false&listId=qr5aAYL6-UxlDyY8DhBlTA&clkid=wT20fuXaEX-dyTA0opSPP2wlUkQ0k6VR2QUVWU0&lnm=Online Tracking Link&afid=Thehttp://uw.thebump.com/admin/edit/34393925 Knot%2C Inc. and Subsidiaries&ref=tgt_adv_"} } }; client.Post<ManualRegistryUrlConversionRequest, ManualRegistryUrlConversionResult>(url, req); }