I am using entity framework to alter data on my remote tables.
One working call I do is this:
public async Task<List<PictureItems>?> GetUserThumbnailByuserId(string userid)
{
await InitializeAsync();
try
{
return await _table.GetAsyncItems().Where(x => x.BelongsToUserId == userid).ToListAsync();
}
catch (Exception e)
{
return null;
}
}
Now, I am trying to delete an item where Ids match.
But all I can do to delete the correct item is:
await _table.DeleteItemAsync(item);
But this would only work if I inserted an identical item into the (). So I could get the right item, if the item is not null then insert into the delete and the item is deleted.
But I dont wanna get the item all the times when I have the ID already locally available, this would just create unneccissary traffic.
So what I would need is something like:
_table.DeleteItemAsync().Where(x => x.BelongsToUserId == userid).ToListAsync();
Anyone got any help for me how to approach this?
Best,
J