Class PointService
  
  
  
  
  
  
  Assembly: Coree.NETASP.dll
  Syntax
  
    public class PointService : IPointService
   
  Constructors
  
    |
    Edit this page
  
  
    View Source
  
  
  PointService(IOptions<PointServiceOptions>, ILogger<PointService>, IHostApplicationLifetime)
  
  
  Declaration
  
    public PointService(IOptions<PointServiceOptions> options, ILogger<PointService> logger, IHostApplicationLifetime hostApplicationLifetime)
   
  Parameters
  
  Methods
  
    |
    Edit this page
  
  
    View Source
  
  
  AddOrUpdateEntry(string, int, string)
  Assigns points to a specific IP address.
 
  
  Declaration
  
    public Task AddOrUpdateEntry(string key, int points, string reason)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | string | 
        key | 
         | 
      
      
        | int | 
        points | 
        The number of points to assign. 
 | 
      
      
        | string | 
        reason | 
        The reason for assigning points. 
 | 
      
    
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  DeleteEntry(string)
  
  
  Declaration
  
    public Task DeleteEntry(string key)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | string | 
        key | 
         | 
      
    
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  DeleteKeySemaphore(string)
  Deletes the semaphore for a specified key if it exists.
 
  
  Declaration
  
    public void DeleteKeySemaphore(string key)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | string | 
        key | 
        The key for which to delete the semaphore. 
 | 
      
    
  
  
    |
    Edit this page
  
  
    View Source
  
  
  GetEntry(string)
  Gets all point entries for a specific IP address.
 
  
  Declaration
  
    public Task<Entry?> GetEntry(string key)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | string | 
        key | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Task<Entry> | 
        An Entry object containing point entries. 
 | 
      
    
  
  
    |
    Edit this page
  
  
    View Source
  
  
  LoadData()
  Loads the point data from disk.
 
  
  Declaration
  
  
    |
    Edit this page
  
  
    View Source
  
  
  SaveData()
  Saves the point data to disk.
 
  
  Declaration
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ShrinkEntrys(string)
  
  
  Declaration
  
    public Task ShrinkEntrys(string key)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | string | 
        key | 
         | 
      
    
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  SortEntriesByLastUpdatedAsync()
  Sorts the dictionary by the LastUpdated property of each entry.
 
  
  Declaration
  
    public void SortEntriesByLastUpdatedAsync()
   
  
    |
    Edit this page
  
  
    View Source
  
  
  StartAsync(CancellationToken)
  
  
  Declaration
  
    public Task StartAsync(CancellationToken cancellationToken)
   
  Parameters
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  StopAsync(CancellationToken)
  
  
  Declaration
  
    public Task StopAsync(CancellationToken cancellationToken)
   
  Parameters
  
  Returns
  
  Implements