|
|
|
|
@ -3,6 +3,7 @@ using Expedience.Infrastructure;
|
|
|
|
|
using Expedience.Infrastructure.Concurrency;
|
|
|
|
|
using Expedience.Infrastructure.Models;
|
|
|
|
|
using MassTransit;
|
|
|
|
|
using static MassTransit.Monitoring.Performance.BuiltInCounters;
|
|
|
|
|
|
|
|
|
|
namespace Expedience.Api.Consumers
|
|
|
|
|
{
|
|
|
|
|
@ -71,13 +72,15 @@ namespace Expedience.Api.Consumers
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogWarning($"The Result with Id {message.Uploadid} has already been uploaded");
|
|
|
|
|
_logger.LogWarning($"The Result with Id {message.UploadId} has already been uploaded");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert this territory if it does not exist
|
|
|
|
|
var territory = dbContext.Territories.FirstOrDefault(t => t.TerritoryId == completionResult.TerritoryId);
|
|
|
|
|
if (territory == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("Adding territory {territoryId} - {contentName}", completionResult.TerritoryId, message.DutyInfo.ContentName);
|
|
|
|
|
|
|
|
|
|
dbContext.Territories.Add(new Models.Territory
|
|
|
|
|
{
|
|
|
|
|
TerritoryId = completionResult.TerritoryId,
|
|
|
|
|
|