using System;
using System.Collections.Generic;
using System.Linq;
using Domain;

namespace Infrastructure.Repositories.Memory
{
  public class LinkRepository : ILinkRepository
  {
    public List<Link> Links { get; }

    public LinkRepository(params Link[] links)
    {
      Links = links.ToList();
    }

    public void Add(Link link)
    {
      Links.Add(link);
    }

    public Link GetById(Guid id)
    {
      return Links.Single(link => link.Id == id);
    }
  }
}