Fix backtest
This commit is contained in:
@@ -28,7 +28,7 @@ public class BotRepository : IBotRepository
|
||||
|
||||
public async Task UpdateBackupBot(BotBackup bot)
|
||||
{
|
||||
var b = await _botRepository.FindOneAsync(b => b.Name == bot.Name);
|
||||
var b = await _botRepository.FindOneAsync(b => b.Identifier == bot.Identifier);
|
||||
var dto = MongoMappers.Map(bot);
|
||||
dto.Id = b.Id;
|
||||
_botRepository.Update(dto);
|
||||
|
||||
@@ -10,4 +10,6 @@ public class BotDto : Document
|
||||
public string Name { get; set; }
|
||||
public string Data { get; set; }
|
||||
public BotType BotType { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public UserDto User { get; set; }
|
||||
}
|
||||
@@ -720,7 +720,8 @@ public static class MongoMappers
|
||||
|
||||
return new BotDto
|
||||
{
|
||||
Name = bot.Name,
|
||||
User = Map(bot.User),
|
||||
Identifier = bot.Identifier,
|
||||
BotType = bot.BotType,
|
||||
Data = bot.Data,
|
||||
};
|
||||
@@ -732,7 +733,8 @@ public static class MongoMappers
|
||||
|
||||
return new BotBackup
|
||||
{
|
||||
Name = b.Name,
|
||||
User = Map(b.User),
|
||||
Identifier = b.Identifier,
|
||||
BotType = b.BotType,
|
||||
Data = b.Data
|
||||
};
|
||||
|
||||
@@ -197,7 +197,7 @@ public class TradingRepository : ITradingRepository
|
||||
|
||||
public void UpdatePosition(Position position)
|
||||
{
|
||||
var p = _positionRepository.FindOne(p => p.Open.ExchangeOrderId == position.Open.ExchangeOrderId);
|
||||
var p = _positionRepository.FindOne(p => p.Identifier.Equals(position.Identifier));
|
||||
var dto = MongoMappers.Map(position);
|
||||
dto.Id = p.Id;
|
||||
_positionRepository.Update(dto);
|
||||
|
||||
Reference in New Issue
Block a user