Hi All,
I am working on ODATA CRUD concept in F & O data entities. I stuck in ODATA delete call, while deleting the values in data entities, Below is the code i used to delete the data entity values, actually I am receiving the 404 Error,
Could any one help me to implement the delete call, or a sample to delete the F & O Data entity Values via ODATA.
Data entity used : SecurityUserRoleAssociations
public async Task<string> DeleteAsync(AXEntity entity)
{
var fullUrl = ApiUrl + entity.LogicalName + "(";
foreach (var a in entity.Attributes)
{
fullUrl = fullUrl + a.Key + "='" + a.Value.ToString() + "',";
}
var request = new HttpRequestMessage(new HttpMethod("Delete"), fullUrl)
{
Content = new StringContent("{}", Encoding.UTF8, "application/json")
};
var response = await _baseAuthorization.GetHttpCliente().SendAsync(request);
string isSuccess = ResponseValidator.EnsureSuccessStatusCode(response);
return isSuccess;
}
Thanks
Praveen