add List.GetByName() to repo

This commit is contained in:
Collin M. Barrett 2017-10-15 20:22:28 -05:00
parent 315efebfbe
commit 2e15301e4e
2 changed files with 6 additions and 0 deletions

View file

@ -6,5 +6,6 @@ namespace FilterLists.Data.Repositories.Contracts
public interface IListRepository
{
IEnumerable<List> GetAll();
List GetByName(string listName);
}
}

View file

@ -19,5 +19,10 @@ public IEnumerable<List> GetAll()
{
return _filterListsDbContext.List.AsEnumerable();
}
public List GetByName(string listName)
{
return _filterListsDbContext.List.First(x => x.Name == listName);
}
}
}