Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
1.3 kB
9
Indexable
Never
public async Task<bool> UpdateTelematicsDataCollectionStatusAsync(int manufacturerId, int siteId, string dataCollectionStatus, string region, int partnerId)
{
    if (this.dataOptRedisCacheHandler != null && dataCollectionStatus == "2")
    {
        var cacheKey = siteId.ToString("G", NumberFormatInfo.CurrentInfo);
        var cacheEntryOptions = new DistributedCacheEntryOptions
        {
            AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(365)
        };
        await this.dataOptRedisCacheHandler.SetAsync(cacheKey, "2", "SO", cacheEntryOptions).ConfigureAwait(false);
    }
  
    if (this.dataOptRedisCacheHandler != null && dataCollectionStatus == "1")
    {
        var cacheKey = siteId.ToString("G", NumberFormatInfo.CurrentInfo);
        await this.dataOptRedisCacheHandler.DeleteAsync(cacheKey, "SO").ConfigureAwait(false);
    }

    return await this.manufacturerRepository.UpdateTelematicsDataCollectionStatusAsync(manufacturerId, siteId, dataCollectionStatus, region).ConfigureAwait(false);
}

/// <inheritdoc />
public async Task<bool> UpdatePrivacyModeStatusAsync(int manufacturerId, int siteId, string privacyModeStatus, int partnerId)
{ 
    return await this.manufacturerRepository.UpdatePrivacyModeStatusAsync(manufacturerId, siteId, privacyModeStatus).ConfigureAwait(false);
}
Leave a Comment