Refit is recommended by Microsoft (I forget the actual link), so that's not a really helpful MSFT answer IMHO.
Anyway, I found this answer for OData: https://stackoverflow.com/questions/70947350/making-odata-call-using-refit
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an OData query as below.
http://localhost:65202/api/odata/StaffBookings?$select=ID&$filter=Staff/ID eq 1&$expand=Staff($select=ID),Event($select=ID,EventDate;$expand=Client($select=ID,Company))
How can I call it using Refit?
Thanks
Regards
Refit is recommended by Microsoft (I forget the actual link), so that's not a really helpful MSFT answer IMHO.
Anyway, I found this answer for OData: https://stackoverflow.com/questions/70947350/making-odata-call-using-refit
Adding the System.Text.Json.Serialization.JsonPropertyName attribute with the $string to the class property which needs the ODataQueryParms works as well.
public class ODataQueryParms
{
[JsonPropertyName("$select")]
public string? SelectColumns {get; set;}
//Similar for other fields like filter, top and skip
}