Add async for saving backtests
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user