Best Way to Post SfRating Value(s)

Hi,

I am using the below code to post using HttpClient:


var client = new HttpClient();

client.BaseAddress = new Uri("https://www.mydomain.com/post_vote.php");
var content = new FormUrlEncodedContent(new[]
{
    new KeyValuePair<string, string>("item", myItem ),
    new KeyValuePair<string, string>("user", myUser ),
    new KeyValuePair<string, string>("rating", Convert.ToString(e.Value)),
});
var response = await client.PostAsync("https://www.mydomain.com/post_vote.php", content);



This is working perfectly when posting a single value to MySQL database

But what if I have SfList which has SfRating in every row and I have a button:


async void ButtonSave_Clicked(System.Object sender, System.EventArgs e)

{
         ---- SUBMIT RAFTING VALUES ----
}


and I want upon clicking on the button to read all the values and post it to te database

Posting it through loop or foreach might take a long time and consume bandwidth, correct?

So what is the best practice here?


Thanks,

Jassim


1 Reply

SS Suganya Sethuraman Syncfusion Team February 15, 2022 05:03 PM UTC

Hi Jassim,

We are not aware of your specific application scenario. Could you please provide the complete runnable sample? This will help us to investigate further and provide better solution at earliest.

Regards,
Suganya Sethuraman.
 


Loader.
Up arrow icon