'Delete multiple Items from a List of Id's using Entity Framework
I need to delete multiple Ids from a List of Ids.
public IHttpActionResult Delete(List<string> IDs)
{
DealBazarEntities.Restaurants.RemoveRange(IDs);
DealBazarEntities.SaveChanges();
}
But RemoveRange does not allow multiple ids , it expect only List<entities>.
Yes, I know that , if I send list of entities to server instead of sending List of ids , Then I can easily accomplish this. But I don't like that.
Again, I don't want to use foreach loop to loop through every Ids.
Solution 1:[1]
Your issue looks like it might be with the assignment to phantom.publicKey itself and not your code. Replacing phantom.public key with a defined public key below works.
const solanaWeb3 = require('@solana/web3.js');
const public_key=new solanaWeb3.PublicKey("your Solana public address with non-0 balance");
(async () => {
const connection = new solanaWeb3.Connection(
solanaWeb3.clusterApiUrl('devnet'),
'confirmed',
);
if (public_key !== null) {
const balance = await connection.getBalance(public_key);
console.log(balance)
}
})();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Iceee |
