Do not update the masterBotUserId if update change it to null
This commit is contained in:
@@ -80,7 +80,8 @@ public class PostgreSqlBotRepository : IBotRepository
|
|||||||
existingEntity.LastStartTime = bot.LastStartTime;
|
existingEntity.LastStartTime = bot.LastStartTime;
|
||||||
existingEntity.LastStopTime = bot.LastStopTime;
|
existingEntity.LastStopTime = bot.LastStopTime;
|
||||||
existingEntity.AccumulatedRunTimeSeconds = bot.AccumulatedRunTimeSeconds;
|
existingEntity.AccumulatedRunTimeSeconds = bot.AccumulatedRunTimeSeconds;
|
||||||
existingEntity.MasterBotUserId = bot.MasterBotUserId;
|
existingEntity.MasterBotUserId =
|
||||||
|
bot.MasterBotUserId ?? existingEntity.MasterBotUserId;
|
||||||
|
|
||||||
await _context.SaveChangesAsync().ConfigureAwait(false);
|
await _context.SaveChangesAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user