sharee.bike-App/SharedBusinessLogic/Model/Bikes/IBikeCollection.cs

36 lines
883 B
C#
Raw Normal View History

2023-04-19 12:14:14 +02:00
using System.Collections.Generic;
2021-05-13 20:03:07 +02:00
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Model.Bikes
2021-05-13 20:03:07 +02:00
{
2022-09-06 16:08:19 +02:00
public interface IBikeDictionary<T> : IReadOnlyCollection<T>
{
/// <summary>
/// Gets a bike by its id.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
T GetById(string id);
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary>
2023-04-19 12:14:14 +02:00
/// Determines whether a bike by given key exists.
2022-09-06 16:08:19 +02:00
/// </summary>
/// <param name="p_strKey">Key to check.</param>
/// <returns>True if bike exists.</returns>
bool ContainsKey(string id);
}
public interface IBikeDictionaryMutable<T> : IBikeDictionary<T>
{
/// <summary>
/// Removes a bike by its id.
/// </summary>
/// <param name="id">Id of bike to be removed.</param>
void RemoveById(string id);
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary>
2023-04-19 12:14:14 +02:00
/// Adds a new element to dictionary.
2022-09-06 16:08:19 +02:00
/// </summary>
/// <param name="newElement">New element to add.</param>
void Add(T newElement);
}
2021-05-13 20:03:07 +02:00
}