I have a a view model that looks like.
public class StoreItemViewModel
{
public Guid ItemId { get; set; }
public List StoreIds { get; set; }
RestSharp now has a more streamlined way to add an object to the RestRequest Body with Json Serialization:
public static IRestResponse Create(object objectToUpdate, string apiEndPoint) where T : new()
{
var client = new RestClient(CreateBaseUrl(null))
{
Authenticator = new HttpBasicAuthenticator("user", "Password1")
};
var request = new RestRequest(apiEndPoint, Method.POST);
request.AddJsonBody(objectToUpdate); // HERE
var response = client.Execute(request);
return response;
}
This was found in RestSharp 105.0.1.0