|
@@ -28,7 +28,6 @@ using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
-using Dapper;
|
|
|
using Microsoft.AspNetCore.Http.HttpResults;
|
|
|
using MongoDB.Driver.Core.Connections;
|
|
|
using EVCB_OCPP20.Packet.DataTypes;
|
|
@@ -258,10 +257,12 @@ internal partial class ProfileHandler
|
|
|
|
|
|
session.IsPending = false;
|
|
|
|
|
|
- var confirm = new BootNotificationConfirmation() {
|
|
|
- currentTime = DateTime.UtcNow,
|
|
|
+ var confirm = new BootNotificationConfirmation()
|
|
|
+ {
|
|
|
+ currentTime = DateTime.UtcNow,
|
|
|
interval = session.IsPending ? 5 : heartbeat_interval,
|
|
|
- status = session.IsPending ? RegistrationStatus.Pending : RegistrationStatus.Accepted };
|
|
|
+ status = session.IsPending ? RegistrationStatus.Pending : RegistrationStatus.Accepted
|
|
|
+ };
|
|
|
|
|
|
result.Message = confirm;
|
|
|
result.Success = true;
|
|
@@ -284,7 +285,8 @@ internal partial class ProfileHandler
|
|
|
{
|
|
|
preStatus = _oldStatus.Status;
|
|
|
|
|
|
- await mainDbService.UpdateConnectorStatus(_oldStatus.Id, new ConnectorStatus() {
|
|
|
+ await mainDbService.UpdateConnectorStatus(_oldStatus.Id, new ConnectorStatus()
|
|
|
+ {
|
|
|
CreatedOn = _request.timestamp.HasValue ? _request.timestamp.Value : DateTime.UtcNow,
|
|
|
Status = (int)_request.status,
|
|
|
ChargePointErrorCodeId = (int)_request.errorCode,
|
|
@@ -347,7 +349,7 @@ internal partial class ProfileHandler
|
|
|
result.Success = true;
|
|
|
|
|
|
statusNotificationTimer.Stop();
|
|
|
- if(statusNotificationTimer.ElapsedMilliseconds/1000 > 1)
|
|
|
+ if (statusNotificationTimer.ElapsedMilliseconds / 1000 > 1)
|
|
|
{
|
|
|
logger.LogCritical(string.Format("StatusNotification took {0}/{1}/{2}/{3}/{4}", s1, s2, s3, s4, s5));
|
|
|
}
|
|
@@ -445,7 +447,7 @@ internal partial class ProfileHandler
|
|
|
await mainDbService.AddServerMessage(
|
|
|
ChargeBoxId: session.ChargeBoxId,
|
|
|
OutAction: Actions.DataTransfer.ToString(),
|
|
|
- OutRequest:
|
|
|
+ OutRequest:
|
|
|
new DataTransferRequest()
|
|
|
{
|
|
|
messageId = "ID_TxEnergy",
|
|
@@ -480,7 +482,7 @@ internal partial class ProfileHandler
|
|
|
case Actions.StartTransaction:
|
|
|
{
|
|
|
var timer = Stopwatch.StartNew();
|
|
|
- long t0 = 0, t1 = 0, t2 = 0, t3 = 0,t4 =0, t5 = 0;
|
|
|
+ long t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0;
|
|
|
|
|
|
StartTransactionRequest _request = request as StartTransactionRequest;
|
|
|
|
|
@@ -537,60 +539,58 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var _CustomerId = await mainDbService.GetCustomerIdByChargeBoxId(session.ChargeBoxId);
|
|
|
+ t2 = timer.ElapsedMilliseconds;
|
|
|
|
|
|
- using (var db = await maindbContextFactory.CreateDbContextAsync())
|
|
|
- {
|
|
|
- var _CustomerId = await db.Machine.Where(x => x.ChargeBoxId == session.ChargeBoxId).Include(x => x.Customer).
|
|
|
- Select(x => x.CustomerId).FirstOrDefaultAsync();
|
|
|
- t2 = timer.ElapsedMilliseconds;
|
|
|
-
|
|
|
- var _existedTx = await db.TransactionRecord.Where(x => x.CustomerId == _CustomerId && x.ChargeBoxId == session.ChargeBoxId
|
|
|
- && x.ConnectorId == _request.connectorId && x.StartTime == _request.timestamp).Select(C => new { C.Id }).AsNoTracking().FirstOrDefaultAsync();
|
|
|
- t3 = timer.ElapsedMilliseconds;
|
|
|
-
|
|
|
- TransactionRecord _newTransaction = new TransactionRecord();
|
|
|
+ var _existedTx = await mainDbService.TryGetDuplicatedTransactionId(session.ChargeBoxId, _CustomerId, _request.connectorId, _request.timestamp);
|
|
|
+ t3 = timer.ElapsedMilliseconds;
|
|
|
|
|
|
+ if (_existedTx != null)
|
|
|
+ {
|
|
|
+ _transactionId = _existedTx.Value;
|
|
|
+ logger.LogError("Duplication ***************************************************** " + _existedTx);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ TransactionRecord _newTransaction;//= new TransactionRecord();
|
|
|
+ _newTransaction = new TransactionRecord()
|
|
|
+ {
|
|
|
+ ChargeBoxId = session.ChargeBoxId,
|
|
|
+ ConnectorId = (byte)_request.connectorId,
|
|
|
+ CreatedOn = DateTime.UtcNow,
|
|
|
+ StartIdTag = _request.idTag,
|
|
|
+ MeterStart = _request.meterStart,
|
|
|
+ CustomerId = _CustomerId,
|
|
|
+ StartTime = _request.timestamp.ToUniversalTime(),
|
|
|
+ ReservationId = _request.reservationId.HasValue ? _request.reservationId.Value : 0,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (session.UserPrices.ContainsKey(_request.idTag))
|
|
|
+ {
|
|
|
+ _newTransaction.Fee = !session.IsBilling ? string.Empty : session.UserPrices[_request.idTag];
|
|
|
|
|
|
- if (_existedTx == null)
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- _newTransaction = new TransactionRecord()
|
|
|
- {
|
|
|
- ChargeBoxId = session.ChargeBoxId,
|
|
|
- ConnectorId = (byte)_request.connectorId,
|
|
|
- CreatedOn = DateTime.UtcNow,
|
|
|
- StartIdTag = _request.idTag,
|
|
|
- MeterStart = _request.meterStart,
|
|
|
- CustomerId = _CustomerId,
|
|
|
- StartTime = _request.timestamp.ToUniversalTime(),
|
|
|
- ReservationId = _request.reservationId.HasValue ? _request.reservationId.Value : 0,
|
|
|
- };
|
|
|
+ _newTransaction.Fee = !session.IsBilling ? string.Empty : session.BillingMethod == 1 ? JsonConvert.SerializeObject(session.ChargingPrices) : session.ChargingFeebyHour.ToString();
|
|
|
+ _newTransaction.Fee += !session.IsBilling ? string.Empty : "|+" + accountBalance + "+" + "&" + session.ParkingFee + "&|" + session.Currency;
|
|
|
+ }
|
|
|
|
|
|
- if (session.UserPrices.ContainsKey(_request.idTag))
|
|
|
- {
|
|
|
- _newTransaction.Fee = !session.IsBilling ? string.Empty : session.UserPrices[_request.idTag];
|
|
|
+ //using (var db = await maindbContextFactory.CreateDbContextAsync())
|
|
|
+ //{
|
|
|
+ // await db.TransactionRecord.AddAsync(_newTransaction);
|
|
|
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _newTransaction.Fee = !session.IsBilling ? string.Empty : session.BillingMethod == 1 ? JsonConvert.SerializeObject(session.ChargingPrices) : session.ChargingFeebyHour.ToString();
|
|
|
- _newTransaction.Fee += !session.IsBilling ? string.Empty : "|+" + accountBalance + "+" + "&" + session.ParkingFee + "&|" + session.Currency;
|
|
|
- }
|
|
|
+ // await db.SaveChangesAsync();
|
|
|
|
|
|
- db.TransactionRecord.Add(_newTransaction);
|
|
|
+ // _transactionId = _newTransaction.Id;
|
|
|
+ //}
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
- t4 = timer.ElapsedMilliseconds;
|
|
|
+ _transactionId = await mainDbService.AddNewTransactionRecord(_newTransaction);
|
|
|
+ t4 = timer.ElapsedMilliseconds;
|
|
|
|
|
|
- _transactionId = _newTransaction.Id;
|
|
|
- logger.LogInformation("***************************************************** ");
|
|
|
- logger.LogInformation(string.Format("{0} :TransactionId {1} ", session.ChargeBoxId, _newTransaction.Id));
|
|
|
- logger.LogInformation("***************************************************** ");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _transactionId = _existedTx.Id;
|
|
|
- logger.LogError("Duplication ***************************************************** " + _existedTx.Id);
|
|
|
- }
|
|
|
+ logger.LogInformation("***************************************************** ");
|
|
|
+ logger.LogInformation(string.Format("{0} :TransactionId {1} ", session.ChargeBoxId, _transactionId));
|
|
|
+ logger.LogInformation("***************************************************** ");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -608,7 +608,7 @@ internal partial class ProfileHandler
|
|
|
t5 = timer.ElapsedMilliseconds;
|
|
|
if (t5 > 1000)
|
|
|
{
|
|
|
- logger.Log(LogLevel.Critical, "{action} {sessisonId} time {t0}/{t1}/{t2}/{t3}/{t4}/{totalTime}", action.ToString(), session.SessionID, t0, t1, t2, t3, t4, t5);
|
|
|
+ logger.Log(LogLevel.Critical, "{action} {ChargeBoxId} time {t0}/{t1}/{t2}/{t3}/{t4}/{totalTime}", action.ToString(), session.ChargeBoxId, t0, t1, t2, t3, t4, t5);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -627,11 +627,12 @@ internal partial class ProfileHandler
|
|
|
getServiceTime = stopTrasactionTimer.ElapsedMilliseconds;
|
|
|
|
|
|
|
|
|
- var _idTagInfo = string.IsNullOrEmpty(_request.idTag) ? null : (
|
|
|
- _request.idTag == "Backend" ?
|
|
|
- new IdTagInfo() {
|
|
|
- expiryDate = utcNow.AddDays(1),
|
|
|
- status = AuthorizationStatus.Accepted
|
|
|
+ var _idTagInfo = string.IsNullOrEmpty(_request.idTag) ? null : (
|
|
|
+ _request.idTag == "Backend" ?
|
|
|
+ new IdTagInfo()
|
|
|
+ {
|
|
|
+ expiryDate = utcNow.AddDays(1),
|
|
|
+ status = AuthorizationStatus.Accepted
|
|
|
} :
|
|
|
(await businessService.Authorize(session.ChargeBoxId, _request.idTag)).IdTagInfo
|
|
|
);
|
|
@@ -644,99 +645,112 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
- using (var db = await maindbContextFactory.CreateDbContextAsync())
|
|
|
+ //遠傳太久以前的停止充電 直接拒絕 避免電樁持續重送~~~~~~~
|
|
|
+ if (_request.timestamp < new DateTime(2021, 11, 1))
|
|
|
{
|
|
|
- var transaction = db.TransactionRecord.Where(x => x.Id == _request.transactionId
|
|
|
- && x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
|
|
|
+ var confirm = new StopTransactionConfirmation()
|
|
|
+ {
|
|
|
+ idTagInfo = new IdTagInfo()
|
|
|
+ {
|
|
|
+ status = AuthorizationStatus.Invalid
|
|
|
+ }
|
|
|
|
|
|
+ };
|
|
|
+
|
|
|
+ result.Message = confirm;
|
|
|
+ result.Success = true;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
+ TransactionRecord transaction;
|
|
|
+ transaction = await mainDbService.GetTransactionForStopTransaction(_request.transactionId, session.ChargeBoxId);
|
|
|
+ //using (var db = await maindbContextFactory.CreateDbContextAsync())
|
|
|
+ //{
|
|
|
+ // transaction = db.TransactionRecord.Where(x => x.Id == _request.transactionId
|
|
|
+ // && x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
|
|
|
+ //}
|
|
|
|
|
|
- //遠傳太久以前的停止充電 直接拒絕 避免電樁持續重送~~~~~~~
|
|
|
- if (_request.timestamp < new DateTime(2021, 11, 1))
|
|
|
+ if (transaction is null)
|
|
|
+ {
|
|
|
+ result.Exception = new Exception("Can't find transactionId " + _request.transactionId);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _ConnectorId = transaction.ConnectorId;
|
|
|
+
|
|
|
+ var confirm = new StopTransactionConfirmation()
|
|
|
{
|
|
|
- var confirm = new StopTransactionConfirmation()
|
|
|
- {
|
|
|
- idTagInfo = new IdTagInfo()
|
|
|
- {
|
|
|
- status = AuthorizationStatus.Invalid
|
|
|
- }
|
|
|
+ idTagInfo = _idTagInfo
|
|
|
|
|
|
- };
|
|
|
+ };
|
|
|
|
|
|
+ //Avoid rewrite transaction data
|
|
|
+ if (transaction.StopTime != GlobalConfig.DefaultNullTime)
|
|
|
+ {
|
|
|
result.Message = confirm;
|
|
|
result.Success = true;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if (transaction is null)
|
|
|
+ await mainDbService.UpdateTransaction(_request.transactionId,
|
|
|
+ meterStop: _request.meterStop,
|
|
|
+ stopTime: _request.timestamp.ToUniversalTime(),
|
|
|
+ stopReasonId: _request.reason.HasValue ? (int)_request.reason.Value : 0,
|
|
|
+ stopReason: _request.reason.HasValue ? _request.reason.Value.ToString() : Reason.Local.ToString(),
|
|
|
+ stopIdTag: _request.idTag,
|
|
|
+ receipt: string.Empty,
|
|
|
+ cost: session.IsBilling ? -1 : 0);
|
|
|
+
|
|
|
+ //using (var db = await maindbContextFactory.CreateDbContextAsync())
|
|
|
+ //{
|
|
|
+ // var _transaction = db.TransactionRecord.Where(x => x.Id == _request.transactionId
|
|
|
+ // && x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
|
|
|
+
|
|
|
+ // _transaction.MeterStop = _request.meterStop;
|
|
|
+ // _transaction.StopTime = _request.timestamp.ToUniversalTime();
|
|
|
+ // _transaction.StopReasonId = _request.reason.HasValue ? (int)_request.reason.Value : 0;
|
|
|
+ // _transaction.StopReason = _request.reason.HasValue ? _request.reason.Value.ToString() : Reason.Local.ToString();
|
|
|
+ // _transaction.StopIdTag = _request.idTag;
|
|
|
+ // _transaction.Receipt = string.Empty;
|
|
|
+ // _transaction.Cost = session.IsBilling ? -1 : 0;
|
|
|
+
|
|
|
+ // //await db.SaveChangesAsync();
|
|
|
+ // await db.SaveChangesAsync();
|
|
|
+ //}
|
|
|
+
|
|
|
+
|
|
|
+ if (_request.transactionData != null && _request.transactionData.Count > 0)
|
|
|
{
|
|
|
-
|
|
|
- result.Exception = new Exception("Can't find transactionId " + _request.transactionId);
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var confirm = new StopTransactionConfirmation()
|
|
|
- {
|
|
|
- idTagInfo = _idTagInfo
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
- //Avoid rewrite transaction data
|
|
|
- if (transaction.StopTime != GlobalConfig.DefaultNullTime)
|
|
|
- {
|
|
|
- result.Message = confirm;
|
|
|
- result.Success = true;
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- _ConnectorId = transaction.ConnectorId;
|
|
|
- transaction.MeterStop = _request.meterStop;
|
|
|
- transaction.StopTime = _request.timestamp.ToUniversalTime();
|
|
|
- transaction.StopReasonId = _request.reason.HasValue ? (int)_request.reason.Value : 0;
|
|
|
- transaction.StopReason = _request.reason.HasValue ? _request.reason.Value.ToString() : Reason.Local.ToString();
|
|
|
- transaction.StopIdTag = _request.idTag;
|
|
|
- transaction.Receipt = string.Empty;
|
|
|
- transaction.Cost = session.IsBilling ? -1 : 0;
|
|
|
-
|
|
|
- if (_request.transactionData != null && _request.transactionData.Count > 0)
|
|
|
+ _request.transactionData[0].sampledValue.Add(new SampledValue()
|
|
|
{
|
|
|
- _request.transactionData[0].sampledValue.Add(new SampledValue()
|
|
|
- {
|
|
|
- context = ReadingContext.Transaction_End,
|
|
|
- format = ValueFormat.Raw,
|
|
|
- location = Location.Outlet,
|
|
|
- phase = _request.transactionData[0].sampledValue.Where(x => x.context.HasValue).Select(x => x.phase).FirstOrDefault(),
|
|
|
- unit = UnitOfMeasure.Wh,
|
|
|
- measurand = Measurand.TotalEnergy,
|
|
|
- value = decimal.Subtract(transaction.MeterStop, transaction.MeterStart).ToString()
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //await db.SaveChangesAsync();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ context = ReadingContext.Transaction_End,
|
|
|
+ format = ValueFormat.Raw,
|
|
|
+ location = Location.Outlet,
|
|
|
+ phase = _request.transactionData[0].sampledValue.Where(x => x.context.HasValue).Select(x => x.phase).FirstOrDefault(),
|
|
|
+ unit = UnitOfMeasure.Wh,
|
|
|
+ measurand = Measurand.TotalEnergy,
|
|
|
+ value = decimal.Subtract(transaction.MeterStop, transaction.MeterStart).ToString()
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ if (session.IsBilling)
|
|
|
+ {
|
|
|
+ await mainDbService.AddServerMessage(
|
|
|
+ ChargeBoxId: session.ChargeBoxId,
|
|
|
+ OutAction: Actions.DataTransfer.ToString(),
|
|
|
+ OutRequest:
|
|
|
+ new DataTransferRequest()
|
|
|
+ {
|
|
|
+ messageId = "ID_TxEnergy",
|
|
|
+ vendorId = "Phihong Technology",
|
|
|
+ data = JsonConvert.SerializeObject(new { txId = _request.transactionId, ConnectorId = transaction.ConnectorId })
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- if (session.IsBilling)
|
|
|
- {
|
|
|
- await mainDbService.AddServerMessage(
|
|
|
- ChargeBoxId: session.ChargeBoxId,
|
|
|
- OutAction: Actions.DataTransfer.ToString(),
|
|
|
- OutRequest:
|
|
|
- new DataTransferRequest()
|
|
|
- {
|
|
|
- messageId = "ID_TxEnergy",
|
|
|
- vendorId = "Phihong Technology",
|
|
|
- data = JsonConvert.SerializeObject(new { txId = _request.transactionId, ConnectorId = transaction.ConnectorId })
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
+ result.Message = confirm;
|
|
|
+ result.Success = true;
|
|
|
|
|
|
- result.Message = confirm;
|
|
|
- result.Success = true;
|
|
|
- }
|
|
|
}
|
|
|
dbOpTime = watch.ElapsedMilliseconds;
|
|
|
|
|
@@ -787,8 +801,8 @@ internal partial class ProfileHandler
|
|
|
|
|
|
if (stopTrasactionTimer.ElapsedMilliseconds > 1000)
|
|
|
{
|
|
|
- logger.Log(LogLevel.Critical, "ExecuteCoreRequest {action} {sessisonId} took {time} sec", action.ToString(), session.SessionID, stopTrasactionTimer.ElapsedMilliseconds / 1000);
|
|
|
- logger.Log(LogLevel.Critical, "{action} {sessisonId} time {getDateTime}/{serviceTime}/{tagInfoTime}/{dbOpTime}/{meterValueTime}", action.ToString(), session.SessionID, getDateTimeTime, getServiceTime, getTagInfoTime, dbOpTime, meterValueTime);
|
|
|
+ logger.Log(LogLevel.Critical, "ExecuteCoreRequest {action} {ChargeBoxId} took {time} sec", action.ToString(), session.ChargeBoxId, stopTrasactionTimer.ElapsedMilliseconds / 1000);
|
|
|
+ logger.Log(LogLevel.Critical, "{action} {ChargeBoxId} time {getDateTime}/{serviceTime}/{tagInfoTime}/{dbOpTime}/{meterValueTime}", action.ToString(), session.ChargeBoxId, getDateTimeTime, getServiceTime, getTagInfoTime, dbOpTime, meterValueTime);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -869,7 +883,7 @@ internal partial class ProfileHandler
|
|
|
watch.Stop();
|
|
|
if (watch.ElapsedMilliseconds / 1000 > 3)
|
|
|
{
|
|
|
- logger.LogError("Processing " + action.ToString() + " costs " + watch.ElapsedMilliseconds / 1000 + " seconds"); ;
|
|
|
+ logger.LogError("Processing " + action.ToString() + " costs " + watch.ElapsedMilliseconds / 1000 + " seconds"); ;
|
|
|
}
|
|
|
//}
|
|
|
|
|
@@ -1158,7 +1172,7 @@ internal partial class ProfileHandler
|
|
|
await mainDbService.AddServerMessage(
|
|
|
ChargeBoxId: session.ChargeBoxId,
|
|
|
OutAction: Actions.DataTransfer.ToString(),
|
|
|
- OutRequest:
|
|
|
+ OutRequest:
|
|
|
new DataTransferRequest()
|
|
|
{
|
|
|
messageId = "FinalCost",
|
|
@@ -1226,7 +1240,7 @@ internal partial class ProfileHandler
|
|
|
await mainDbService.AddServerMessage(
|
|
|
ChargeBoxId: session.ChargeBoxId,
|
|
|
OutAction: Actions.DataTransfer.ToString(),
|
|
|
- OutRequest:
|
|
|
+ OutRequest:
|
|
|
new DataTransferRequest()
|
|
|
{
|
|
|
messageId = "RunningCost",
|
|
@@ -1423,7 +1437,7 @@ internal partial class ProfileHandler
|
|
|
|
|
|
if (_confirm.status == Packet.Messages.SubTypes.ConfigurationStatus.Accepted || _confirm.status == Packet.Messages.SubTypes.ConfigurationStatus.RebootRequired)
|
|
|
{
|
|
|
- var configure = db.MachineConfigurations.Where(x => x.ChargeBoxId == session.ChargeBoxId).ToList();
|
|
|
+ var configure = await db.MachineConfigurations.Where(x => x.ChargeBoxId == session.ChargeBoxId).ToListAsync();
|
|
|
|
|
|
var foundConfig = configure.Find(x => x.ConfigureName == _request.key);
|
|
|
if (foundConfig != null)
|
|
@@ -1433,7 +1447,7 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- db.MachineConfigurations.Add(new MachineConfiguration()
|
|
|
+ await db.MachineConfigurations.AddAsync(new MachineConfiguration()
|
|
|
{
|
|
|
ChargeBoxId = session.ChargeBoxId,
|
|
|
ConfigureName = _request.key,
|
|
@@ -1488,7 +1502,7 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- db.MachineConfigurations.Add(new MachineConfiguration()
|
|
|
+ await db.MachineConfigurations.AddAsync(new MachineConfiguration()
|
|
|
{
|
|
|
ChargeBoxId = session.ChargeBoxId,
|
|
|
ConfigureName = item.key,
|
|
@@ -1515,7 +1529,7 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- db.MachineConfigurations.Add(new MachineConfiguration()
|
|
|
+ await db.MachineConfigurations.AddAsync(new MachineConfiguration()
|
|
|
{
|
|
|
ChargeBoxId = session.ChargeBoxId,
|
|
|
ConfigureName = item
|