Checkpoint: DataStore<TId, TEntity>
Challenge on lesson: Checkpoint โ The Generic Data Store
CHALLENGE
Difficulty: intermediate+25 XP
Implement the DataStore described in the checkpoint:
``csharp
public abstract class Entity<TId> { public abstract TId Id { get; } }
public class DataStore<TId, TEntity>
where TEntity : Entity<TId>
where TId : IComparable<TId>
{
public void Add(TEntity entity);
public TEntity? Get(TId id);
public bool Delete(TId id);
public List<TEntity> AllOrdered();
public TEntity? FirstMatching(Predicate<TEntity> match);
}
``
Press Submit to check your solution.
Back to lesson: Checkpoint โ The Generic Data Store