Add async for saving backtests

This commit is contained in:
2025-11-05 16:58:46 +07:00
parent db6e06ad5d
commit 5afddb895e
3 changed files with 14 additions and 2 deletions

View File

@@ -32,6 +32,16 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
_context.SaveChanges();
}
public async Task InsertBacktestForUserAsync(User user, Backtest result)
{
ValidateBacktestData(result);
result.User = user;
var entity = PostgreSqlMappers.Map(result);
_context.Backtests.Add(entity);
await _context.SaveChangesAsync();
}
/// <summary>
/// Validates that all numeric fields in the backtest are of the correct type
/// </summary>