Infört en möjlighet att rensa transtabellen

This commit is contained in:
2024-02-01 11:44:45 +01:00
parent ef14ce2aaa
commit 05dfd1f35b
6 changed files with 117 additions and 22 deletions

View File

@ -87,6 +87,21 @@ public class AccountRecordRepository : IAccountRecordRepository
return false;
}
public bool DeleteAllAccountRecords()
{
try
{
var all = from c in _dataContext.AccountRecords select c;
_dataContext.AccountRecords.RemoveRange(all);
_dataContext.SaveChanges();
return true;
}
catch (Exception e)
{
_logger.LogError("Error occured in DeleteAllAccountRecord :-->{iMessage}", e.Message);
}
return false;
}
public IEnumerable<AccountRecord> GetAllAccBetweenDates(DateTime dateFrom, DateTime dateTo)
{
IEnumerable<AccountRecord> result = null;