Store the user statistics for the performance.
This commit is contained in:
@@ -30,7 +30,7 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
_gearRepository.Add(newGear);
|
||||
|
||||
var userId = _identityService.ConnectedUser.Id;
|
||||
_cacheService.Delete(CacheType.Gear, id: userId);
|
||||
_cacheService.Delete(CacheType.Gear, userId: userId);
|
||||
}
|
||||
|
||||
public void AddRentalGear(User newUser)
|
||||
@@ -58,13 +58,13 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
public IEnumerable<Gear> GetAllGears()
|
||||
{
|
||||
var userId = _identityService.ConnectedUser.Id;
|
||||
if (!_cacheService.Contains(CacheType.Gear, id: userId))
|
||||
if (!_cacheService.Contains(CacheType.Gear, userId: userId))
|
||||
_cacheService.Put(CacheType.Gear,
|
||||
_gearRepository.GetAll(_identityService.ConnectedUser),
|
||||
5 * 60 * 1000,
|
||||
id: userId);
|
||||
userId: userId);
|
||||
|
||||
return _cacheService.Get<IEnumerable<Gear>>(CacheType.Gear, id: userId);
|
||||
return _cacheService.Get<IEnumerable<Gear>>(CacheType.Gear, userId: userId);
|
||||
}
|
||||
|
||||
public Gear GetGearById(int id)
|
||||
|
||||
Reference in New Issue
Block a user