mysimulation/server/FSO.Server.Database/DA/LotVisitTotals/SqlLotVisitTotals.cs
Tony Bark 22191ce648 Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib
- Added FreeSO's API server to handle most backend operations
2024-05-01 02:55:43 -04:00

28 lines
877 B
C#
Executable file

using Dapper;
using FSO.Server.Database.DA.Utils;
using System;
using System.Collections.Generic;
namespace FSO.Server.Database.DA.LotVisitTotals
{
public class SqlLotVisitTotals : AbstractSqlDA, ILotVisitTotals
{
public SqlLotVisitTotals(ISqlContext context) : base(context)
{
}
public void Insert(IEnumerable<DbLotVisitTotal> input)
{
try {
Context.Connection.ExecuteBufferedInsert("INSERT INTO fso_lot_visit_totals (lot_id, date, minutes) VALUES (@lot_id, @date, @minutes) ON DUPLICATE KEY UPDATE minutes=VALUES(minutes)", input, 100);
}catch(Exception ex)
{
}
}
public void Purge(DateTime date)
{
Context.Connection.Execute("DELETE FROM fso_lot_visit_totals WHERE date < @date", new { date = date });
}
}
}