Add comments by AI
This commit is contained in:
@@ -32,6 +32,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
var userId = _identityService.ConnectedUser.Id;
|
||||
_cacheService.Delete(CacheType.Gear, userId: userId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds a new gear item to the system.
|
||||
/// </summary>
|
||||
/// <param name="newGear">The Gear entity containing the new gear data.</param>
|
||||
|
||||
public void AddRentalGear(User newUser)
|
||||
{
|
||||
@@ -49,11 +53,19 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
_gearRepository.Add(rentalGear);
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds rental gear to the system for a new user.
|
||||
/// </summary>
|
||||
/// <param name="newUser">The new user for whom rental gear should be added.</param>
|
||||
|
||||
public void DeleteGearById(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
/// <summary>
|
||||
/// Deletes a gear item by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to delete.</param>
|
||||
|
||||
public IEnumerable<Gear> GetAllGears()
|
||||
{
|
||||
@@ -66,12 +78,21 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
return _cacheService.Get<IEnumerable<Gear>>(CacheType.Gear, userId: userId);
|
||||
}
|
||||
/// <summary>
|
||||
/// Retrieves all gear items.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Gear entities containing all gear data.</returns>
|
||||
|
||||
public Gear GetGearById(int id)
|
||||
{
|
||||
var allGears = GetAllGears();
|
||||
return allGears.Single(g => g.Id == id);
|
||||
}
|
||||
/// <summary>
|
||||
/// Retrieves a gear item by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to retrieve.</param>
|
||||
/// <returns>A Gear entity containing the gear details.</returns>
|
||||
|
||||
public bool UpdateGear(int id, Gear gear)
|
||||
{
|
||||
@@ -79,6 +100,12 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
return _gearRepository.Update(gear);
|
||||
}
|
||||
/// <summary>
|
||||
/// Updates an existing gear item.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to update.</param>
|
||||
/// <param name="gear">Gear entity containing the updated gear data.</param>
|
||||
/// <returns>True if the update was successful, false otherwise.</returns>
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -90,4 +117,4 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user