I have a table where I store the current sales values that I import from an excel file.
Is there a quicker way to do this than each item being deleted?
var query = _crmOpportunityRepository
.GetAll();
foreach (var item in query)
{
await _crmOpportunityRepository.DeleteAsync(item.Id);
}
3 Answer(s)
-
0
Hi,
AspNet Zero and ABP does not have anything for built in bulk operations. If your data is so big, then you can use raw sql, otherwise you can check bulk operation libraries for entity framework.
Thanks.
-
0
Hi,
Would I load the Nuget for this into the Application, Core, or EntitiyFrameworkCore Projects?
-
0
Hi, You can execute TRUNCATE TABLE tableName query for cleanup table. Or if there's performance bottleneck while deleting records you can use Dapper. ABP has integration with dapper. <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Nuget-Packages#abpdapper">https://aspnetboilerplate.com/Pages/Doc ... #abpdapper</a>